mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 21:14:02 +00:00
Install command
This commit is contained in:
parent
2381bf1e01
commit
b611f10db7
1 changed files with 10 additions and 3 deletions
|
|
@ -34,11 +34,18 @@ class Install extends Command
|
||||||
]);
|
]);
|
||||||
$this->info('✔️ Created config/tenancy.php');
|
$this->info('✔️ Created config/tenancy.php');
|
||||||
|
|
||||||
\file_put_contents(app_path('Http/Kernel.php'), \str_replace(
|
$newKernel = \str_replace(
|
||||||
'protected $middlewarePriority = [',
|
'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'))
|
\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');
|
$this->info('✔️ Set middleware priority');
|
||||||
|
|
||||||
\file_put_contents(
|
\file_put_contents(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue