Laravel where not in
DB::table(‘table_name’)->whereNotIn(‘column_name’,[value1,value2,value3….])->get(); is used for where NotIn condition in laravel.
Laravel where Not In clause Example
We are going to fetch data with whereNotIn clause in laravel from the table emp.
DB::table('emp')->whereNotIn('salary',[10000,20000,30000])->get();
Will Generate the following query.
//Select * from emp where salary NOT IN (10000, 20000, 30000) ;
Advertisements