From 394a9fa562c7c9868ebfe7d5f2e309a07b69b56d Mon Sep 17 00:00:00 2001 From: lukinovec Date: Thu, 3 Sep 2026 16:24:17 +0200 Subject: [PATCH] Explicitly skip scoped disks in diskRoot() If diskRoot() somehow ended up receiving a scoped disk (e.g. in case the scoped disk was listed in tenancy.filesystem.disks), its root would get configured, and it'd be completely redundant. It wouldn't break anything since scoped disk's configured root is ignored -- its parent's root is always used. Even though not adding this skipping code would essentially do no harm, it prevents the method from doing redundant work and defines the behavior a bit more clearly. diskUrl() is similar in that regard, but that method already has a strict "disk driver has to be 'local'" -- scoped disks never made it through so nothing to change there. --- src/Bootstrappers/FilesystemTenancyBootstrapper.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Bootstrappers/FilesystemTenancyBootstrapper.php b/src/Bootstrappers/FilesystemTenancyBootstrapper.php index 57f98114..16721e27 100644 --- a/src/Bootstrappers/FilesystemTenancyBootstrapper.php +++ b/src/Bootstrappers/FilesystemTenancyBootstrapper.php @@ -140,6 +140,11 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper protected function diskRoot(string $disk, Tenant|false $tenant): void { + if ($this->app['config']["filesystems.disks.$disk.driver"] === 'scoped') { + // Skip scoped disks since they have no root to override + return; + } + if ($tenant === false) { $this->app['config']["filesystems.disks.$disk.root"] = $this->originalDisks[$disk]['root'];