1
0
Fork 0
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:
lukinovec 2024-08-28 00:42:36 +02:00 committed by GitHub
parent 6b74589d76
commit 2c0f61585d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 8 deletions

View file

@ -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 . '/';
* };
*/
}