Answers for "with in laravel query"

PHP
7

laravel not in query

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

join in laravel eloquent

$customer = DB::table('customers')
                ->join('shops', 'customers.shop_id', '=', 'shops.shop_id')
                ->where('customer_contact', $contact_no)
                ->get();
Posted by: Guest on October-06-2020
1

DB::table('users')->get();

$users = DB::table('users')->get();
Posted by: Guest on October-22-2020
0

Laravel query where and

Table::where('Column', Value)->where('NewColumn', Value)->get();
Posted by: Guest on September-04-2020
0

laravel query when

$role = $request->input('role');

$users = DB::table('users')
                ->when($role, function ($query, $role) {
                    return $query->where('role_id', $role);
                })
                ->get();
Posted by: Guest on September-14-2020

Browse Popular Code Answers by Language