query to get last record from sql in laravel code example
Example 1: laravel get last record
Model::latest()->first();
Example 2: get the last saved row in a table laravel
$last = DB::table('items;)->latest()->first();
Model::latest()->first();
$last = DB::table('items;)->latest()->first();