We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DB::unprepared()
lock tables
protected $connection
$request->offsetSet('key', 'value')
offsetSet
$request->all()
$request->aa = 'value'
->all()
$model->newCollection([$model1, $model2])
$models->load()
$model->groupBy('field')->count()
$model->count(DB::raw('distinct field'))
nohup php artisan queue:work --queue=email --timeout=180 --tries=3 --delay=1 > /dev/null 2>&1 &
encryptCookies
Illuminate\Support\Collection
keyBy
\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Collection.php
merge
getKey()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
DB::unprepared()
可以执行lock tables
之类的命令protected $connection
,否则引号会判断错$request->offsetSet('key', 'value')
在中间件里修改/新增参数,offsetSet
设置的参数可直接通过$request->all()
获取到,如果通过$request->aa = 'value'
设置的话不会在->all()
里获取到$model->newCollection([$model1, $model2])
把原本是很多模型的数组变成可以使用$models->load()
预加载关系的形式$model->groupBy('field')->count()
获取到的总数是第一个分组的数量是错的,解决方案是在获取总数时使用$model->count(DB::raw('distinct field'))
获取,这样原本带筛选条件的模型, clone一下就可以用来统计总数了nohup php artisan queue:work --queue=email --timeout=180 --tries=3 --delay=1 > /dev/null 2>&1 &
encryptCookies
中间件,那么在api加载的中间件顺序时候需要把encryptCookies
放第一个Illuminate\Support\Collection
)那么是正常覆盖相同键的;如果集合是模型(从数据库查询出来的Eloquent对象),那么merge时会使用主键,而不是指定的key,所以keyBy
无效, 源码在\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Collection.php
的merge
函数,可以看到使用了模型的getKey()
函数获取主键。The text was updated successfully, but these errors were encountered: