Quantcast
Channel: Laravel Eloquent "WHERE NOT IN" - Stack Overflow
Browsing latest articles
Browse All 14 View Live

Answer by samzna for Laravel Eloquent "WHERE NOT IN"

Query Builder: DB::table('book_mast')->select('book_name','dt_of_pub','pub_lang','no_page','book_price') ->whereNotIn('book_price',...

View Article



Answer by Manoj for Laravel Eloquent "WHERE NOT IN"

or try pluck in laravelhereDB::table('user') ->select('id','name') ->whereNotIn('id', DB::table('curses')->where('id_user', '=', $id)->pluck('user_id')) ->get();

View Article

Answer by Mohammad Ali Abdullah for Laravel Eloquent "WHERE NOT IN"

$created_po = array(); $challan = modelname::where('fieldname','!=', 0)->get(); // dd($challan); foreach ($challan as $rec){ $created_po[] = array_push($created_po,$rec->fieldname); } $data =...

View Article

Answer by Stefan Pavlov for Laravel Eloquent "WHERE NOT IN"

This is my working variant for Laravel 7DB::table('user') ->select('id','name') ->whereNotIn('id', DB::table('curses')->where('id_user', $id)->pluck('id_user')->toArray()) ->get();

View Article

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 =...

View Article


Answer by Vladimir Salguero for Laravel Eloquent "WHERE NOT IN"

I had problems making a sub query until I added the method ->toArray() to the result, I hope it helps more than one since I had a good time looking for the solution.ExampleDB::table('user')...

View Article

Answer by khandar shailesh for Laravel Eloquent "WHERE NOT IN"

You can do following.DB::table('book_mast') ->selectRaw('book_name,dt_of_pub,pub_lang,no_page,book_price') ->whereNotIn('book_price',[100,200]);

View Article

Answer by Baiquni for Laravel Eloquent "WHERE NOT IN"

You can use this example for dynamically calling the Where NOT IN$user = User::where('company_id', '=', 1)->select('id)->get()->toArray();$otherCompany = User::whereNotIn('id', $user)->get();

View Article


Answer by Zahid Hasan for Laravel Eloquent "WHERE NOT IN"

You can use WhereNotIn in the following way:$category=DB::table('category') ->whereNotIn('category_id',[14 ,15]) ->get();`enter code here`

View Article


Answer by Hari Pudyal for Laravel Eloquent "WHERE NOT IN"

The dynamic way of implement whereNotIn: $users = User::where('status',0)->get(); foreach ($users as $user) { $data[] = $user->id; } $available = User::orderBy('name', 'DEC')->whereNotIn('id',...

View Article

Answer by Md. Saidur Rahman Milon for Laravel Eloquent "WHERE NOT IN"

You can use WhereNotIn in following way also:ModelName::whereNotIn('book_price', [100,200])->get(['field_name1','field_name2']);This will return collection of Record with specific fields

View Article

Answer by Jarek Tkaczyk for Laravel Eloquent "WHERE NOT IN"

Query Builder:DB::table(..)->select(..)->whereNotIn('book_price', [100,200])->get();Eloquent:SomeModel::select(..)->whereNotIn('book_price', [100,200])->get();

View Article

Laravel Eloquent "WHERE NOT IN"

I'm having trouble to write query in laravel eloquent ORM. my query is SELECT book_name,dt_of_pub,pub_lang,no_page,book_price FROM book_mast WHERE book_price NOT IN (100,200);Now I want to convert this...

View Article


Answer by Tursunboy Faiziev for Laravel Eloquent "WHERE NOT IN"

YourModel::select('column_name')->whereNotIn('book_price', [100,200])->get();

View Article
Browsing latest articles
Browse All 14 View Live




Latest Images