Answers for "where id last get in laravel"

PHP
2

return last inserted id in laravel

$id = DB::table('users')->insertGetId([
    'email' => '[email protected]',
    'votes' => 0
]);
Posted by: Guest on April-05-2021
0

Get last id in laravel

$last2 = DB::table('items')->orderBy('id', 'DESC')->first();
Posted by: Guest on July-11-2020

Browse Popular Code Answers by Language