How Get The Latest Data In Database In Laravel

how get the latest data in database in laravel
$last = DB::table('items')->latest()->first();

$last2 = DB::table('items')->orderBy('id', 'DESC')->first();

 

Leave a Comment