Answers for "how to use DB to find the latest record in laravel 8"

PHP
1

how get the latest data in database in laravel

$last = DB::table('items')->latest()->first();

$last2 = DB::table('items')->orderBy('id', 'DESC')->first();
Posted by: Guest on April-07-2021

Code answers related to "how to use DB to find the latest record in laravel 8"

Browse Popular Code Answers by Language