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

Add the PreventAccess MW to tenant routes by default

This commit is contained in:
Samuel Štancl 2019-10-15 20:02:09 +02:00
parent 6d13ff825a
commit 3f16be1963
2 changed files with 4 additions and 0 deletions

View file

@ -47,6 +47,9 @@ class Install extends Command
$newKernel = str_replace("'web' => [", "'web' => [
\Stancl\Tenancy\Middleware\PreventAccessFromTenantDomains::class,", $newKernel);
$newKernel = str_replace("'api' => [", "'api' => [
\Stancl\Tenancy\Middleware\PreventAccessFromTenantDomains::class,", $newKernel);
file_put_contents(app_path('Http/Kernel.php'), $newKernel);
$this->info('✔️ Set middleware priority');

View file

@ -39,6 +39,7 @@ class Kernel extends HttpKernel
],
'api' => [
\Stancl\Tenancy\Middleware\PreventAccessFromTenantDomains::class,
'throttle:60,1',
'bindings',
],