Quantcast
Viewing all articles
Browse latest Browse all 14

Answer by Vinay Kaithwas for Laravel Eloquent "WHERE NOT IN"

Its simply means that you have an array of values and you want record except that values/records.

you can simply pass a array into whereNotIn() laravel function.

With query builder

$users = DB::table('applications')                    ->whereNotIn('id', [1,3,5])                     ->get(); //will return without applications which contain this id's

With eloquent.

$result = ModelClassName::select('your_column_name')->whereNotIn('your_column_name', ['satatus1', 'satatus2']); //return without application which contain this status.

Viewing all articles
Browse latest Browse all 14

Trending Articles