Answers for "laravel how to get latest row from db"

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 "laravel how to get latest row from db"

Browse Popular Code Answers by Language