# 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.

- URL: https://laravel-vuejs.space/laravel-bootstrap-app-php
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs, PHP

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](https://laravel-vuejs.space/application-setup) 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.php` from an old tutorial into this app.
> -   Do not point the Vue pages at `routes/api.php` so they “go through bootstrap”.
>
> **Who it's for:** Laravel + Vue developers
>
> **Applies to:** Laravel 13 · Vue 3

## The fix

```php
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

**Q: 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.

**Q: 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.
