SS
Size: a a a
SS
SG
DB::enableQueryLog(); // Enable query log
// Your Eloquent query executed by using get()
dd(DB::getQueryLog()); // Show results of log
🎃
AH
composer require andrey-helldar/laravel-support
dd_sql($builder)
MB
D
D
SS
MB
I
AH
WHERE id = 1 AND id = 2 AND id = 3...То есть ID одновременно должен равняться всем значениям.
category
не подтянется в жадную загрузку - его users
перезаписывает.$recipes = User::query()
->with('category', 'user')
->withCount('saves')
->whereNotIn('state', [Recipe::STATE_IN_REVIEW, Recipe::STATE_CANCELED])
->whereHas('ingredients', static function (Builder $builder) use ($ingredients) {
$builder->whereIn('id', $ingredients);
}, '>=', count($ingredients))
->latest('id')
->get();
Е
SG
SG
SG
SG
AH
Е
Е
AH