Skip to content

Jetstream doesn't add middleware to the web group during installation (Laravel 12.0.10) #1576

Closed
@lukinovec

Description

@lukinovec

Jetstream Version

5.3.6

Jetstream Stack

Inertia

Laravel Version

12.0.10

PHP Version

8.4.7

Database Driver & Version

No response

Description

In Laravel 12.0.10, the closure passed to the withMiddleware() call now has a void return type (laravel/laravel#6628). Because of that, while installing Jetstream, the installMiddleware() method cannot find ->withMiddleware(function (Middleware $middleware) { (it's ->withMiddleware(function (Middleware $middleware): void { now) and add middleware to the web group.

Steps To Reproduce

laravel new jetstream-inertia-test --no-interaction
cd jetstream-inertia-test
composer require laravel/jetstream
php artisan jetstream:install inertia

See that in bootstrap/app.php, there's nothing added to the web middleware group. There should be

$middleware->web(append: [
    \App\Http\Middleware\HandleInertiaRequests::class,
    \Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions