mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-15 00:04:04 +00:00
[1.8.0] Allow conflicting routes (#114)
* PreventAccessFromTenantDomains middleware * Apply fixes from StyleCI * Install command * Switch order of middleware * Apply middleware to $middleware instead of web, fix tests * Apply fixes from StyleCI * Fix tests * Fix tests * wip * wip
This commit is contained in:
parent
2fd3662eb7
commit
0a57f9d3df
3 changed files with 40 additions and 4 deletions
|
|
@ -36,11 +36,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\PreventAccessFromTenantDomains::class,
|
||||
\Stancl\Tenancy\Middleware\InitializeTenancy::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(
|
||||
|
|
@ -58,7 +65,7 @@ class Install extends Command
|
|||
|
|
||||
*/
|
||||
|
||||
Route::get('/your/application/homepage', function () {
|
||||
Route::get('/', function () {
|
||||
return 'This is your multi-tenant application. The uuid of the current tenant is ' . tenant('uuid');
|
||||
});
|
||||
"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue