Answered by : lokesh-ramchandani-in6l3jq294i2
DB::table(..)->select(..)->whereNotIn('book_price', [100,200])->get();
Source : | Last Update : Sat, 03 Oct 20
Answered by : alberto-peripolli
$users = DB::table('users') ->join('contacts', 'users.id', '=', 'contacts.user_id') ->join('orders', 'users.id', '=', 'orders.user_id') ->select('users.*', 'contacts.phone', 'orders.price') ->get();
Source : https://laravel.com/docs/7.x/queries#joins | Last Update : Wed, 06 May 20
Answered by : xanthous-xenomorph-uohoc2s5s8v0
$users = DB::table('users') ->whereIn('id', [1, 2, 3]) ->get();
Source : | Last Update : Thu, 07 May 20
Answered by : stormy-spider-b4lja64opzoe
$count = DB::table('category_issue')->count();
Source : https://stackoverflow.com/questions/13223512/how-to-select-count-with-laravels-fluent-query-builder | Last Update : Mon, 13 Jul 20
Answered by : dfg
$users = User::whereNotIn('id', [1,2,3,4]);
Source : https://www.parthpatel.net/laravel-whereIn-whereNotIn-eloquent-query/ | Last Update : Wed, 27 Jul 22
Answered by : wandering-wryneck-a7zjwm5h8p5v
$users = DB::table('users') ->whereMonth('created_at', '12') ->get();
Source : https://laravel.com/docs/7.x/queries | Last Update : Mon, 21 Sep 20
Answered by : suhail-khan
<?php
$flights = App\Models\Flight::all();
foreach ($flights as $flight) { echo $flight->name;
}
Source : https://laravel.com/docs/8.x/eloquent | Last Update : Thu, 15 Oct 20