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

Refactor Storage facade changes

This commit is contained in:
Erik Gaal 2022-03-02 21:30:40 +01:00
parent e1ab850c32
commit 4e6bfc9aac
No known key found for this signature in database
GPG key ID: 8733B288F439A599

View file

@ -57,19 +57,20 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
Storage::forgetDisk($this->app['config']['tenancy.filesystem.disks']);
foreach ($this->app['config']['tenancy.filesystem.disks'] as $disk) {
$root = $this->app['config']->get("filesystems.disks.{$disk}.root");
$this->originalPaths['disks'][$disk] = $root;
$originalRoot = $this->app['config']["filesystems.disks.{$disk}.root"];
$this->originalPaths['disks'][$disk] = $originalRoot;
if (!($root = str_replace(
$finalPrefix = str_replace(
'%storage_path%',
storage_path(),
$this->app['config']["tenancy.filesystem.root_override.{$disk}"] ?? ''
))) {
$root = "{$root}/{$suffix}";
$this->app['config']["tenancy.filesystem.root_override.{$disk}"] ?? '',
);
if (! $finalPrefix) {
$finalPrefix = $originalRoot . '/'. $suffix;
}
$this->app['config']["filesystems.disks.{$disk}.root"] = $root;
$this->app['config']["filesystems.disks.{$disk}.root"] = $finalPrefix;
}
}