【发布时间】:2017-11-02 14:58:28
【问题描述】:
关注这个帖子How to create multiple where clause query using Laravel Eloquent?
我正在尝试插入多个“和”条件:
$matchThese = ['destination.country' => 'china', 'doc.description' => 'business'];
return $collection->where($matchThese);
但我收到此错误:
Too few arguments to function Illuminate\Support\Collection::where(), 1 passed . . . but two expected
【问题讨论】:
-
where 需要两个参数,您可能可以这样做 return $collection->where($matchThese[0], $matchThese[1]);
标签: php laravel laravel-eloquent