Answers for "laravel fetch the last from the database"

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 fetch the last from the database"

Browse Popular Code Answers by Language