Answered by : kevin-x8phzry21f6x
Model::latest()->first();
Source : | Last Update : Wed, 13 May 20
Answered by : witty-wasp-2hv8jb1kxqyj
Dogs::latest()->take(5)->get();
Source : https://stackoverflow.com/questions/24860973/laravel-how-to-get-last-n-entries-from-db | Last Update : Sun, 30 May 21
Answered by : tiago-frana
Model::latest()->first();
Source : https://stackoverflow.com/questions/16549455/select-last-row-in-the-table | Last Update : Tue, 10 Nov 20
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
Answered by : misty-mallard-o1s0upmw6bc1
return DB::table('files')->order_by('upload_time', 'desc')->first();
Source : https://stackoverflow.com/questions/16549455/select-last-row-in-the-table | Last Update : Tue, 02 Jun 20
Answered by : kingsley-uchenna
$user = User::orderBy('id', 'desc')->first();
Source : | Last Update : Sun, 25 Sep 22