diff --git a/src/Commands/Install.php b/src/Commands/Install.php index f753ed3c..261b95a7 100644 --- a/src/Commands/Install.php +++ b/src/Commands/Install.php @@ -42,7 +42,7 @@ class Install extends Command \file_get_contents(app_path('Http/Kernel.php')) ); - $newKernel = \str_replace("'web' => [", "'web' => [ + $newKernel = \str_replace("protected \$middleware = [", "protected \$middleware = [ \Stancl\Tenancy\Middleware\PreventAccessFromTenantDomains::class,", $newKernel); \file_put_contents(app_path('Http/Kernel.php'), $newKernel); diff --git a/tests/CommandsTest.php b/tests/CommandsTest.php index f1e6e4d5..22eb99bc 100644 --- a/tests/CommandsTest.php +++ b/tests/CommandsTest.php @@ -286,6 +286,7 @@ class Kernel extends HttpKernel * @var array */ protected \$middlewarePriority = [ + \Stancl\Tenancy\Middleware\PreventAccessFromTenantDomains::class, \Stancl\Tenancy\Middleware\InitializeTenancy::class, \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class,