In this article, We will explain to you how to use the WhereIn query in laravel(laravel eloquent WhereIn query example). here we will give you a simple example of laravel eloquent WhereIn query.
The laravel eloquent provides many types of eloquent methods. the WhereIn method takes two parameters column names and array. the array parameter should be a numeric array.
So you can see below the following example.
$students = DB::table('students') ->whereIn('id', [4, 5, 6]) ->get();
Please follow and like us: