/ Published in: PHP
In Laravel you can use "IN" query as
Using Eloquent
$data = YourModel::whereIn('id', array(1, 2, 3))->get();
Using DB Query builder
$data = DB::table('your_table')->whereIn('id', array(1, 2, 3))->get();
Using Eloquent
$data = YourModel::whereIn('id', array(1, 2, 3))->get();
Using DB Query builder
$data = DB::table('your_table')->whereIn('id', array(1, 2, 3))->get();
Expand |
Embed | Plain Text
URL: http://www.laravelinterviewquestions.com/trick/in-query-in-laravel-eloquent-mje/