WhereNotIn method of laravel db builder and Eloquent is used to select records that are not in given array.
Where not in Example
whereNotIn Query Builder Example:
DB::table('yourtable')->select(..)->whereNotIn('id', [100,200])->get();
whereNotIn Eloquent Example:
YourModel::select(..)->whereNotIn('id', [100,200])->get();
This post is submitted by one of our members. You may submit a new post here.
Laravel interview Questions © 2019 - Designed by PSD to HTML