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

Update comments

This commit is contained in:
lukinovec 2025-02-11 12:22:10 +01:00
parent d8129ac2cc
commit 509279f188
2 changed files with 5 additions and 4 deletions

View file

@ -16,7 +16,8 @@ use Stancl\Tenancy\Resolvers\PathTenantResolver;
* TenancyUrlGenerator does two extra things: * TenancyUrlGenerator does two extra things:
* *
* - Autofills the tenant parameter in the tenant context with the current tenant if $passTenantParameterToRoutes is enabled. * - Autofills the tenant parameter in the tenant context with the current tenant if $passTenantParameterToRoutes is enabled.
* With path identification, this is done by URL::defaults() when UrlGeneratorBootstrapper::$addTenantParameterToDefaults is true (which is the default). * With path identification, this is required to be done by URL::defaults() -- setting
* UrlGeneratorBootstrapper::$addTenantParameterToDefaults (which is false by default) to true handles that.
* Enabling $passTenantParameterToRoutes is preferable with query string identification. * Enabling $passTenantParameterToRoutes is preferable with query string identification.
* *
* - Prepends the route name passed to route() and URL::temporarySignedRoute() * - Prepends the route name passed to route() and URL::temporarySignedRoute()
@ -38,8 +39,8 @@ class TenancyUrlGenerator extends UrlGenerator
* - route('tenant.home', [$bypassParameter => true]) => app.test/tenant -- query string identification (no query string passed) * - route('tenant.home', [$bypassParameter => true]) => app.test/tenant -- query string identification (no query string passed)
* *
* With path identification, it is recommended to pass the tenant parameter automatically by setting * With path identification, it is recommended to pass the tenant parameter automatically by setting
* UrlGeneratorBootstrapper::$addTenantParameterToDefaults to true. * UrlGeneratorBootstrapper::$addTenantParameterToDefaults to true,
* In that case, this class should only affect the automatic route name prefixing, * and in that case, this affects only the automatic route name prefixing,
* and the forceful route name overrides set in the $override property. * and the forceful route name overrides set in the $override property.
* *
* @see UrlGeneratorBootstrapper * @see UrlGeneratorBootstrapper

View file

@ -127,7 +127,7 @@ test('url generator can override specific route names while all other functional
Route::get('/foo', fn () => 'foo')->name('foo'); Route::get('/foo', fn () => 'foo')->name('foo');
Route::get('/bar', fn () => 'bar')->name('bar'); Route::get('/bar', fn () => 'bar')->name('bar');
Route::get('/baz', fn () => 'baz')->name('baz'); // not overridden Route::get('/baz', fn () => 'baz')->name('baz'); // Not overridden
TenancyUrlGenerator::$override = ['foo' => 'bar']; TenancyUrlGenerator::$override = ['foo' => 'bar'];