From ac90ef08e485ebb7e2dc2217862357ef1a5edba4 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 21 Apr 2026 13:46:26 +0200 Subject: [PATCH] Improve wording --- 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 36d869e8..2b236114 100644 --- a/src/Overrides/TenancyUrlGenerator.php +++ b/src/Overrides/TenancyUrlGenerator.php @@ -22,7 +22,8 @@ use Stancl\Tenancy\Resolvers\RequestDataTenantResolver; * - Automatically passing ['tenant' => ...] to each route() call -- if TenancyUrlGenerator::$passTenantParameterToRoutes is enabled * This is a more universal solution since it supports both path identification and query parameter identification. * - * - Prepends route names with `tenant.` (or the configured prefix) if $prefixRouteNames is enabled. + * - Prepends route names with the tenant route name prefix ('tenant.' by default, + * configurable at tenant_route_name_prefix under PathTenantResolver) if $prefixRouteNames is enabled. * This is primarily useful when using route cloning with path identification. * * Affected methods: route(), toRoute(), temporarySignedRoute(), signedRoute() (the last two via the route() override). @@ -131,8 +132,8 @@ class TenancyUrlGenerator extends UrlGenerator } /** - * Override the toRoute() method so that the route name gets prefixed - * and the tenant parameter gets added when in tenant context. + * Override the toRoute() to prefix the route name + * and add the tenant parameter when in tenant context. * * Also affects route(). Even though route() is overridden separately, it delegates parameter handling to toRoute(). */ diff --git a/tests/Bootstrappers/UrlGeneratorBootstrapperTest.php b/tests/Bootstrappers/UrlGeneratorBootstrapperTest.php index 422c630b..18664b06 100644 --- a/tests/Bootstrappers/UrlGeneratorBootstrapperTest.php +++ b/tests/Bootstrappers/UrlGeneratorBootstrapperTest.php @@ -402,7 +402,7 @@ test('the bypass parameter works correctly with temporarySignedRoute', function( ->not()->toContain('central='); // Bypass parameter gets removed from the generated URL }); -test('the toRoute method can automatically prefix the passed route name', function () { +test('toRoute can automatically prefix the passed route name', function () { config(['tenancy.bootstrappers' => [UrlGeneratorBootstrapper::class]]); Route::get('/central/home', fn () => 'central')->name('home');