Get last id in laravel
snippet in php

Get last id in laravel

user1948

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

laravel db insert get last id

user9303

$id = DB::table('users')

  ->insertGetId(

	  ['name' => 'Akash Savani', 'email'=>'akash@gmail.com']

);

Get last id in laravel

user5636

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

Get last id in laravel

user9177

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

laravel get last id

user7417

DB::table('myTable')->orderBy('id','desc')->first();