1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 21:14:02 +00:00

Apply middleware to $middleware instead of web, fix tests

This commit is contained in:
Samuel Štancl 2019-08-23 12:58:29 +02:00
parent ad424dcdd3
commit 965f67c747
2 changed files with 2 additions and 1 deletions

View file

@ -42,7 +42,7 @@ class Install extends Command
\file_get_contents(app_path('Http/Kernel.php')) \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); \Stancl\Tenancy\Middleware\PreventAccessFromTenantDomains::class,", $newKernel);
\file_put_contents(app_path('Http/Kernel.php'), $newKernel); \file_put_contents(app_path('Http/Kernel.php'), $newKernel);

View file

@ -286,6 +286,7 @@ class Kernel extends HttpKernel
* @var array * @var array
*/ */
protected \$middlewarePriority = [ protected \$middlewarePriority = [
\Stancl\Tenancy\Middleware\PreventAccessFromTenantDomains::class,
\Stancl\Tenancy\Middleware\InitializeTenancy::class, \Stancl\Tenancy\Middleware\InitializeTenancy::class,
\Illuminate\Session\Middleware\StartSession::class, \Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class,