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

Move tenant routes to a stub file

This commit is contained in:
Samuel Štancl 2019-10-19 21:17:06 +02:00
parent 867a905ed3
commit aeb3ca0e40
2 changed files with 18 additions and 21 deletions

View file

@ -0,0 +1,16 @@
<?php
/*
|--------------------------------------------------------------------------
| Tenant Routes
|--------------------------------------------------------------------------
|
| Here you can register the tenant routes for your application.
| These routes are loaded by the TenantRouteServiceProvider
| with the tenancy and web middleware groups. Good luck!
|
*/
Route::get('/app', function () {
return 'This is your multi-tenant application. The id of the current tenant is ' . tenant('id');
});

View file

@ -53,27 +53,8 @@ class Install extends Command
file_put_contents(app_path('Http/Kernel.php'), $newKernel); file_put_contents(app_path('Http/Kernel.php'), $newKernel);
$this->info('✔️ Set middleware priority'); $this->info('✔️ Set middleware priority');
if (! file_exists(base_path('routes/tenant.php')) { if (! file_exists(base_path('routes/tenant.php'))) {
file_put_contents( file_put_contents(base_path('routes/tenant.php'), file_get_contents(__DIR__ . '/../../assets/tenant_routes.php.stub'));
base_path('routes/tenant.php'),
"<?php
/*
|--------------------------------------------------------------------------
| Tenant Routes
|--------------------------------------------------------------------------
|
| Here you can register the tenant routes for your application.
| These routes are loaded by the TenantRouteServiceProvider
| with the tenancy and web middleware groups. Good luck!
|
*/
Route::get('/app', function () {
return 'This is your multi-tenant application. The id of the current tenant is ' . tenant('id');
});
"
);
$this->info('✔️ Created routes/tenant.php'); $this->info('✔️ Created routes/tenant.php');
} else { } else {
$this->info('Found routes/tenant.php.'); $this->info('Found routes/tenant.php.');