How To Take Last Entry In Database In Laravel Method

[Solved] How To Take Last Entry In Database In Laravel Method | Php - Code Explorer | yomemimo.com
Question : how to take last entry in database in laravel Method Three

Answered by : awful-albatross-qbpi980y0bzo

$last3 = DB::table('items')->latest('id')->first();

Source : https://www.itsolutionstuff.com/post/how-to-get-last-record-of-database-table-in-laravelexample.html | Last Update : Sat, 18 Jul 20

Question : how to take last entry in database in laravel Method ONe

Answered by : awful-albatross-qbpi980y0bzo

$last = DB::table('items')->latest()->first();

Source : https://www.itsolutionstuff.com/post/how-to-get-last-record-of-database-table-in-laravelexample.html | Last Update : Sat, 18 Jul 20

Question : how to take last entry in database in laravel Method Two

Answered by : awful-albatross-qbpi980y0bzo

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

Source : https://www.itsolutionstuff.com/post/how-to-get-last-record-of-database-table-in-laravelexample.html | Last Update : Sat, 18 Jul 20

Answers related to how to take last entry in database in laravel method two

Code Explorer Popular Question For Php