1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 09:54:05 +00:00

Optional storage path suffixing

This commit is contained in:
Samuel Štancl 2019-10-22 19:23:11 +02:00
parent d899dcfcce
commit 8fe7cfbf01
2 changed files with 4 additions and 1 deletions

View file

@ -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',

View file

@ -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'] ?? false) {
$this->app->useStoragePath($this->originalPaths['storage'] . "/{$suffix}");
}
// asset()
if ($this->originalPaths['asset_url']) {