From 6f760ef4cda3f0448842b2983cdbfb4cac0a1809 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 24 Jun 2025 14:40:28 +0200 Subject: [PATCH] Add note about clearing the $routesToClone property --- src/Actions/CloneRoutesAsTenant.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Actions/CloneRoutesAsTenant.php b/src/Actions/CloneRoutesAsTenant.php index 6491bdf1..df3a495c 100644 --- a/src/Actions/CloneRoutesAsTenant.php +++ b/src/Actions/CloneRoutesAsTenant.php @@ -61,6 +61,11 @@ use Stancl\Tenancy\Resolvers\PathTenantResolver; * $cloneAction->cloneRoute('baz')->handle(); * ``` * + * Calling handle() will also clear the $routesToClone array, so that subsequent handle() calls aren't broken. + * This means that $action->cloneRoute('foo')->handle() will clone the 'foo' route, but subsequent calls to handle() will behave + * as if cloneRoute() wasn't called at all ($routesToClone will be empty). + * Note that calling handle() does not reset the other properties. + * * @see Stancl\Tenancy\Resolvers\PathTenantResolver */ class CloneRoutesAsTenant