1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 09:34:04 +00:00

Set config() disk root too

This commit is contained in:
Samuel Stancl 2020-07-14 19:43:14 +02:00 committed by GitHub
parent 3693040892
commit 51cdf55210
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,12 +60,13 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
$this->originalPaths['disks'][$disk] = $filesystemDisk->getAdapter()->getPathPrefix();
if ($root = str_replace('%storage_path%', storage_path(), $this->app['config']["tenancy.filesystem.root_override.{$disk}"])) {
$filesystemDisk->getAdapter()->setPathPrefix($root);
$filesystemDisk->getAdapter()->setPathPrefix($finalPrefix = $root);
} else {
$root = $this->app['config']["filesystems.disks.{$disk}.root"];
$filesystemDisk->getAdapter()->setPathPrefix($root . "/{$suffix}");
$filesystemDisk->getAdapter()->setPathPrefix($finalPrefix = $root . "/{$suffix}");
}
$this->app['config']["filesystems.disks.{$disk}.root"] = $finalPrefix;
}
}
@ -83,7 +84,10 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
/** @var FilesystemAdapter $filesystemDisk */
$filesystemDisk = Storage::disk($disk);
$filesystemDisk->getAdapter()->setPathPrefix($this->originalPaths['disks'][$disk]);
$root = $this->originalPaths['disks'][$disk];
$filesystemDisk->getAdapter()->setPathPrefix($root);
$this->app['config']["filesystems.disks.{$disk}.root"] = $root;
}
}
}