get last from collection laravel code example
Example 1: laravel get last record
Model::latest()->first();
Example 2: Get last id in laravel
$last3 = DB::table('items')->latest('id')->first();
Model::latest()->first();
$last3 = DB::table('items')->latest('id')->first();