mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 09:54:03 +00:00
Adds ability to disable tenant asset routes (#636)
* Add option to enable/disable tenant asset route * Only registers tenant route if enabled in config * Uses proper config key * Move routes config option * Move config to service provider * Moves config to service provider
This commit is contained in:
parent
6bcd327b75
commit
740d670665
2 changed files with 12 additions and 1 deletions
|
|
@ -168,6 +168,15 @@ return [
|
|||
// Stancl\Tenancy\Features\TenantConfig::class, // https://tenancyforlaravel.com/docs/v3/features/tenant-config
|
||||
// Stancl\Tenancy\Features\CrossDomainRedirect::class, // https://tenancyforlaravel.com/docs/v3/features/cross-domain-redirect
|
||||
],
|
||||
|
||||
/**
|
||||
* Should tenancy routes be registered.
|
||||
*
|
||||
* Tenancy routes include tenant asset routes. By default, this route is
|
||||
* enabled. But it may be useful to disable them if you use external
|
||||
* storage (e.g. S3 / Dropbox) or have a custom asset controller.
|
||||
*/
|
||||
'routes' => true,
|
||||
|
||||
/**
|
||||
* Parameters used by the tenants:migrate command.
|
||||
|
|
|
|||
|
|
@ -110,7 +110,9 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
__DIR__ . '/../assets/TenancyServiceProvider.stub.php' => app_path('Providers/TenancyServiceProvider.php'),
|
||||
], 'providers');
|
||||
|
||||
$this->loadRoutesFrom(__DIR__ . '/../assets/routes.php');
|
||||
if (config('tenancy.routes', true)) {
|
||||
$this->loadRoutesFrom(__DIR__ . '/../assets/routes.php');
|
||||
}
|
||||
|
||||
$this->app->singleton('globalUrl', function ($app) {
|
||||
if ($app->bound(FilesystemTenancyBootstrapper::class)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue