The things the comment above your old boot function say go in there (model bindings, pattern filters) seem to go into the boot function in the App\Providers\AppServiceProvider class in Laravel 12 (see https://laravel.com/docs/12.x/routing#parameters-global-constraints and https://laravel.com/docs/12.x/routing#explicit-binding ). Maybe you can access the .env values from there?