get the latest data with laravel latest() 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();