orchestral / testbench

Laravel Testing Helper for Packages Development
https://packages.tools/testbench
MIT License
2.1k stars 136 forks source link

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

Closed ivanvermeyen closed 6 months ago

ivanvermeyen commented 6 months ago

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?