Get next id in auto generated field in Laravel

May 14, 2020

You can use the following code to get the next id of the auto generated field of the table in Laravel,

$statement = DB::select("show table status like 'tickets'");
$statement[0]->Auto_increment