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

Install command

This commit is contained in:
Samuel Štancl 2019-08-23 12:42:01 +02:00
parent 2381bf1e01
commit b611f10db7

View file

@ -34,11 +34,18 @@ class Install extends Command
]);
$this->info('✔️ Created config/tenancy.php');
\file_put_contents(app_path('Http/Kernel.php'), \str_replace(
$newKernel = \str_replace(
'protected $middlewarePriority = [',
"protected \$middlewarePriority = [\n \Stancl\Tenancy\Middleware\InitializeTenancy::class,",
"protected \$middlewarePriority = [
\Stancl\Tenancy\Middleware\InitializeTenancy::class,
\Stancl\Tenancy\Middleware\PreventAccessFromTenantDomains::class",
\file_get_contents(app_path('Http/Kernel.php'))
));
);
$newKernel = \str_replace("'web' => [", "'web' => [
\Stancl\Tenancy\Middleware\PreventAccessFromTenantDomains::class,", $newKernel);
\file_put_contents(app_path('Http/Kernel.php'), $newKernel);
$this->info('✔️ Set middleware priority');
\file_put_contents(