select max id laravel
\DB::table('orders')->where('id', \DB::raw("(select max(`id`) from orders)"))->get();
Here is what the above code is Doing:
1. We’re selecting the max id from the orders table.
2. We’re using that max id to select the row from the orders table.