select in laravel eloquent code example
Example 1: wherein laravel
DB::table('user')->whereIn('id', [100,200])->get();
Example 2: join in laravel eloquent
$customer = DB::table('customers')
->join('shops', 'customers.shop_id', '=', 'shops.shop_id')
->where('customer_contact', $contact_no)
->get();
Example 3: laravel db inserr
DB::table('users')->insert([
'email' => '[email protected]',
'votes' => 0
]);
Example 4: update query in laravel eloquent
$data = DB::table('cart')
->where('crt_id', $id)
->update(['crt_status' =>'0']);