From 965f67c747d907fa449180df06748a51444d5d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Fri, 23 Aug 2019 12:58:29 +0200 Subject: [PATCH] Apply middleware to $middleware instead of web, fix tests --- src/Commands/Install.php | 2 +- tests/CommandsTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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,