How to Make Laravel Eloquent "IN" Query?



PHP Snippet 1:

$users = User::whereIn('id', array(1, 2, 3))->get();

PHP Snippet 2:

$users = DB::table('users')->whereIn('id', array(1, 2, 3))->get();

PHP Snippet 3:

DB::table(Newsletter Subscription)
->select('*')
->whereIn('id', $send_users_list)
->get()

PHP Snippet 4:

$sendUsersList = Newsletter Subscription:: select ('*')
                ->whereIn('id', $send_users_list)
                ->get();

PHP Snippet 5:

$data = Model::whereIn('field_name', [1, 2, 3])->get();

PHP Snippet 6:

$usersList = Users::whereIn('id', [1, 2, 3])->get();

PHP Snippet 7:

$users = User::wherein('id',[1,2,3])->get();

PHP Snippet 8:

$users = DB::table('users')->whereIn('id', [1, 2, 3])->get();

PHP Snippet 9:

$ids = [1,2,3];

$users = User::wherein('id',$ids)->get();

PHP Snippet 10:

User::whereIn('id', [1, 2, 3])->get();

User::whereIntegerInRaw('id', [1, 2, 3])->get();

PHP Snippet 11:

DB::where("id IN(23,25)")->get()

PHP Snippet 12:

DB::whereRaw("id IN(23,25)")->get()