From 509279f188e3d46bf113a9b7b89a57cab2e1cdef Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 11 Feb 2025 12:22:10 +0100 Subject: [PATCH] Update comments --- src/Overrides/TenancyUrlGenerator.php | 7 ++++--- tests/Bootstrappers/UrlGeneratorBootstrapperTest.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Overrides/TenancyUrlGenerator.php b/src/Overrides/TenancyUrlGenerator.php index 82c9af66..b877f0e1 100644 --- a/src/Overrides/TenancyUrlGenerator.php +++ b/src/Overrides/TenancyUrlGenerator.php @@ -16,7 +16,8 @@ use Stancl\Tenancy\Resolvers\PathTenantResolver; * TenancyUrlGenerator does two extra things: * * - 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. * * - 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) * * With path identification, it is recommended to pass the tenant parameter automatically by setting - * UrlGeneratorBootstrapper::$addTenantParameterToDefaults to true. - * In that case, this class should only affect the automatic route name prefixing, + * UrlGeneratorBootstrapper::$addTenantParameterToDefaults to true, + * and in that case, this affects only the automatic route name prefixing, * and the forceful route name overrides set in the $override property. * * @see UrlGeneratorBootstrapper diff --git a/tests/Bootstrappers/UrlGeneratorBootstrapperTest.php b/tests/Bootstrappers/UrlGeneratorBootstrapperTest.php index 4a71397b..1e99e277 100644 --- a/tests/Bootstrappers/UrlGeneratorBootstrapperTest.php +++ b/tests/Bootstrappers/UrlGeneratorBootstrapperTest.php @@ -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('/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'];