retrieve created id laravel code example
Example 1: Get last id in laravel
$last2 = DB::table('items')->orderBy('id', 'DESC')->first();
Example 2: Get last id in laravel
$last = DB::table('items')->latest()->first();
$last2 = DB::table('items')->orderBy('id', 'DESC')->first();
$last = DB::table('items')->latest()->first();