how to get latest data from table in sql laravel code example
Example: how get the latest data in database in laravel
$last = DB::table('items')->latest()->first();
$last2 = DB::table('items')->orderBy('id', 'DESC')->first();
$last = DB::table('items')->latest()->first();
$last2 = DB::table('items')->orderBy('id', 'DESC')->first();