How to use "IN" Query in Laravel ?

/ Published in: PHP
Save to your folder(s)

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();


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.