随笔分类 - laravel
摘要:中文文档: //等值数组查询 where('domain', 'elemmatch',['selfbuild_brand_id'=> $date['selfbuild_brand_id']]) //数组模糊查询 用正则表达式实现 use MongoDB\BSON\Regex; where('doma
阅读全文
摘要:在passport v10以上已经移除了相关设置接口,我们可以重写createToken方法实现指定客户端ID public function createToken($name, array $scopes = []) { $clients = new ClientRepository('9466
阅读全文
摘要:余数一定小于除数,用10作为除数 可以把user表拆分成user0.......user9 根据id 可以确定用户存在哪个表中 查询所有数据 for ($i = 0; $i < 10; $i++) { $queries->push(DB::table('user_operator_record' .
阅读全文
摘要:Schema::table('group_code', function (Blueprint $table) { DB::statement("ALTER TABLE group_code CHANGE COLUMN expire_at expire_at timestamp (0) commen
阅读全文
摘要:select([DB::raw('DATE_FORMAT(starting_time,"%Y-%m-%d") as date'), DB::raw('COUNT(distinct(user_id)) as value')])->groupBy('date')->orderBy('date')->ge
阅读全文
摘要:使用laravel 拓展包 tymon/jwt-auth jwt.auth 作为中间件使用,在一些场景下会触发不识别token报401,实际token是可用的. 请改用auth:api
阅读全文
摘要:overtrue/laravel-wechat:^5.1 -> Laravel/Lumen >= 5.1 可以在文档看到laravel5 推荐用5.1 ,可实际5.1的包在laravel5.4的环境下各种报错,请使用4.0版本即可
阅读全文
摘要:请求没有通过验证器,并且请求头 Accept 如果没设置 application/json 成这个,那么就会出现返回一个默认页的情况。
阅读全文
摘要:数据迁移 执行迁移命令会提示 Specified key was toolong; max key length is 1000 bytes 解决方案如下:\app\Providers\AppServiceProvider.php文件修改默认长度 namespace App\Providers; u
阅读全文

浙公网安备 33010602011771号