diff --git a/assets/config.php b/assets/config.php index 4b0aa810..d5989b33 100644 --- a/assets/config.php +++ b/assets/config.php @@ -42,6 +42,7 @@ return [ ], 'filesystem' => [ // https://tenancy.samuelstancl.me/docs/v2/filesystem-tenancy/ 'suffix_base' => 'tenant', + 'suffix_storage_path' => true, // Note: Disabling this will likely break local disk tenancy. Only disable this if you're using an external file storage service like S3. // Disks which should be suffixed with the suffix_base + tenant id. 'disks' => [ 'local', diff --git a/src/TenancyBootstrappers/FilesystemTenancyBootstrapper.php b/src/TenancyBootstrappers/FilesystemTenancyBootstrapper.php index b08a79e2..5d417f8b 100644 --- a/src/TenancyBootstrappers/FilesystemTenancyBootstrapper.php +++ b/src/TenancyBootstrappers/FilesystemTenancyBootstrapper.php @@ -38,7 +38,9 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper $suffix = $this->app['config']['tenancy.filesystem.suffix_base'] . $tenant->id; // storage_path() - $this->app->useStoragePath($this->originalPaths['storage'] . "/{$suffix}"); + if ($this->app['config']['tenancy.filesystem.suffix_storage_path'] ?? true) { + $this->app->useStoragePath($this->originalPaths['storage'] . "/{$suffix}"); + } // asset() if ($this->originalPaths['asset_url']) {