People searching “Laravel bootstrap/app.php” follow a Laravel 10 article and create app/Http/Kernel.php. On Laravel 11, 12, and 13 the application builder is bootstrap/app.php. The setup guide is the kit that already has this file.
TL;DR
- Laravel 11 and newer register routes, middleware, and the health URL in bootstrap/app.php.
- Do not add Http/Kernel.php back.
- Do not copy a
Kernel.phpfrom an old tutorial into this app. - Do not point the Vue pages at
routes/api.phpso they “go through bootstrap”.
The fix#
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
//
})
->withExceptions(function (Exceptions $exceptions) {
//
})->create();Web routes, including Inertia, stay in routes/web.php. Middleware aliases go in the withMiddleware callback. You do not get a $routeMiddleware array anymore.
What to avoid#
Gotcha
Do not copy a Kernel.php from an old tutorial into this app. The framework will not read it. Do not point the Vue pages at routes/api.php so they “go through bootstrap”. They are web routes.
FAQ#
How do I register routes in bootstrap/app.php?
Laravel 11 and newer register routes, middleware, and the health URL in bootstrap/app.php. Do not add Http/Kernel.php back.
What goes wrong with Laravel bootstrap/app.php?
Many developers follow a Laravel 10 article and create app/Http/Kernel. Do not copy a Kernel.php` from an old tutorial into this app.



