mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 15:54:03 +00:00
Make RootUrlBootstrapper only have an effect in CLI (#58)
* Interrupt RootUrlBootstrapper's bootstrap() execution if the app isn't running in console, add docblock * Improve overrideUrlInTenantContext() documentation [ci skip] * Improve RootUrlBootstrapper [ci skip]
This commit is contained in:
parent
6b74589d76
commit
2c0f61585d
2 changed files with 38 additions and 8 deletions
|
|
@ -137,6 +137,12 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set \Stancl\Tenancy\Bootstrappers\RootUrlBootstrapper::$rootUrlOverride here
|
||||
* to override the root URL used in CLI while in tenant context.
|
||||
*
|
||||
* @see \Stancl\Tenancy\Bootstrappers\RootUrlBootstrapper
|
||||
*/
|
||||
protected function overrideUrlInTenantContext(): void
|
||||
{
|
||||
/**
|
||||
|
|
@ -149,12 +155,12 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
*
|
||||
* $scheme = str($originalRootUrl)->before('://');
|
||||
*
|
||||
* // If you're using subdomain identification:
|
||||
* // $originalDomain = str($originalRootUrl)->after($scheme . '://');
|
||||
* // return $scheme . '://' . $tenantDomain . '.' . $originalDomain . '/';
|
||||
*
|
||||
* // If you're using domain identification:
|
||||
* return $scheme . '://' . $tenantDomain . '/';
|
||||
*
|
||||
* // If you're using subdomain identification:
|
||||
* $originalDomain = str($originalRootUrl)->after($scheme . '://');
|
||||
* return $scheme . '://' . $tenantDomain . '.' . $originalDomain . '/';
|
||||
* };
|
||||
*/
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue