insertgetid laravel code example
Example 1: laravel select count
$count = DB::table('category_issue')->count();
Example 2: laravel find query
$flight = App\Models\Flight::find(1);
$flight = App\Models\Flight::where('active', 1)->first();
$flight = App\Models\Flight::firstWhere('active', 1);
Example 3: laravel find query
return Destination::orderByDesc(
Flight::select('arrived_at')
->whereColumn('destination_id', 'destinations.id')
->orderBy('arrived_at', 'desc')
->limit(1)
)->get();
Example 4: laravel find query
$model = App\Models\Flight::where('legs', '>', 100)->firstOr(function () {
});