mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 16:34:04 +00:00
Refactor Storage facade changes
This commit is contained in:
parent
e1ab850c32
commit
4e6bfc9aac
1 changed files with 9 additions and 8 deletions
|
|
@ -57,19 +57,20 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
|
||||||
Storage::forgetDisk($this->app['config']['tenancy.filesystem.disks']);
|
Storage::forgetDisk($this->app['config']['tenancy.filesystem.disks']);
|
||||||
|
|
||||||
foreach ($this->app['config']['tenancy.filesystem.disks'] as $disk) {
|
foreach ($this->app['config']['tenancy.filesystem.disks'] as $disk) {
|
||||||
$root = $this->app['config']->get("filesystems.disks.{$disk}.root");
|
$originalRoot = $this->app['config']["filesystems.disks.{$disk}.root"];
|
||||||
$this->originalPaths['disks'][$disk] = $root;
|
$this->originalPaths['disks'][$disk] = $originalRoot;
|
||||||
|
|
||||||
if (!($root = str_replace(
|
$finalPrefix = str_replace(
|
||||||
'%storage_path%',
|
'%storage_path%',
|
||||||
storage_path(),
|
storage_path(),
|
||||||
$this->app['config']["tenancy.filesystem.root_override.{$disk}"] ?? ''
|
$this->app['config']["tenancy.filesystem.root_override.{$disk}"] ?? '',
|
||||||
))) {
|
);
|
||||||
$root = "{$root}/{$suffix}";
|
|
||||||
|
if (! $finalPrefix) {
|
||||||
|
$finalPrefix = $originalRoot . '/'. $suffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->app['config']["filesystems.disks.{$disk}.root"] = $root;
|
$this->app['config']["filesystems.disks.{$disk}.root"] = $finalPrefix;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue