get id of last transaction laravel code example Example: laravel get last id DB::table('myTable')->orderBy('id','desc')->first();