Answers for "laravel new query eloquent where not implement in if condition"

PHP
7

laravel not in query

DB::table(..)->select(..)->whereNotIn('book_price', [100,200])->get();
Posted by: Guest on September-26-2020
0

Laravel - Add conditional where clause in query

$user_to_mail = User::where('store_id', $item->store_id)
                    ->when($store->notification_role_id > 0, function ($q) use ($store) {
                        return $q->where('role_id', $store->notification_role_id);
                    })
                    ->get();
Posted by: Guest on November-15-2021

Code answers related to "laravel new query eloquent where not implement in if condition"

Browse Popular Code Answers by Language