Skip to content

Change default middleware in bootstrap/app.php in Laravel 11 #396

@ivanvermeyen

Description

@ivanvermeyen

Hi,

My package needs to run a middleware in the web group in a certain order/priority.

Before Laravel 11, I could stub the Kernel.php file in my base TestCase:

protected function resolveApplicationHttpKernel($app): void
{
    $app->singleton(
        'Illuminate\Contracts\Http\Kernel',
        'My\Tests\Stubs\Kernel'
    );
}

But as of Laravel 11, this is now handled in bootstrap/app.php.
Is there a way to stub this file too?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions