how to get last inserted id in laravel
// how to get last inserted id in laravel
//METHOD-1
$data->save();
$lastId = $data->id;
//METHOD-2
$data = Booking::latest('id')->first();
$id = data->id;
how to get last inserted id in laravel
// how to get last inserted id in laravel
//METHOD-1
$data->save();
$lastId = $data->id;
//METHOD-2
$data = Booking::latest('id')->first();
$id = data->id;
Get last id in laravel
$last3 = DB::table('items')->latest('id')->first();
return last inserted id in laravel
$id = DB::table('users')->insertGetId([
'email' => '[email protected]',
'votes' => 0
]);
return last inserted id in laravel
DB::getPdo()->lastInsertId();
laravel query builder get last insert id
$id = DB::table('users')->insertGetId(
['email' => '[email protected]', 'votes' => 0]
);
laravel get last id
DB::table('myTable')->orderBy('id','desc')->first();
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us