Answers for "how to get the latest record in laravel"

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
6

laravel get last record

Model::latest()->first();
Posted by: Guest on May-06-2020

Code answers related to "how to get the latest record in laravel"

Browse Popular Code Answers by Language