1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 17:24:03 +00:00

[2.2.0] Optional storage path suffixing (#197)

* Optional storage path suffixing

* Default value true
This commit is contained in:
Samuel Štancl 2019-10-27 21:49:28 +01:00 committed by GitHub
parent 869ac32983
commit 3ec4314e91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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'] ?? true) {
$this->app->useStoragePath($this->originalPaths['storage'] . "/{$suffix}");
}
// asset()
if ($this->originalPaths['asset_url']) {