diff --git a/src/Bootstrappers/FilesystemTenancyBootstrapper.php b/src/Bootstrappers/FilesystemTenancyBootstrapper.php index e9e0d93d..2dbba369 100644 --- a/src/Bootstrappers/FilesystemTenancyBootstrapper.php +++ b/src/Bootstrappers/FilesystemTenancyBootstrapper.php @@ -109,10 +109,10 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper $diskConfig = $this->app['config']['filesystems.disks.' . $diskName]; // Storage Url - $url = $this->originalPaths['disks.url.' . $diskName] ?? null; + $url = data_get($this->originalPaths, "disks.url.$diskName"); if ($diskConfig['driver'] === 'local' && ! is_null($url)) { - $$this->app['config']["filesystems.disks.$diskName.url"] = $url; + $this->app['config']["filesystems.disks.$diskName.url"] = $url; } } } diff --git a/tests/BootstrapperTest.php b/tests/BootstrapperTest.php index 96ae90a5..4cab7ddf 100644 --- a/tests/BootstrapperTest.php +++ b/tests/BootstrapperTest.php @@ -298,6 +298,15 @@ test('files can get fetched using the storage url', function() { $parsedUrl = Str::of($url)->after($hostname); expect(file_get_contents(public_path($parsedUrl)))->toBe($tenantKey); + + // Central + tenancy()->end(); + Storage::disk('public')->put($centralFileName = 'central.txt', $centralFileContent = 'central'); + + pest()->artisan('storage:link'); + $url = Storage::disk('public')->url($centralFileName); + + expect(file_get_contents(public_path($url)))->toBe($centralFileContent); }); test('create and delete storage symlinks jobs work', function() {