mirror of
https://github.com/archtechx/tenancy.git
synced 2026-09-20 13:34:04 +00:00
Explicitly skip scoped disks in diskRoot()
If diskRoot() somehow ended up receiving a scoped disk (e.g. in case the scoped disk was listed in tenancy.filesystem.disks), its root would get configured, and it'd be completely redundant. It wouldn't break anything since scoped disk's configured root is ignored -- its parent's root is always used. Even though not adding this skipping code would essentially do no harm, it prevents the method from doing redundant work and defines the behavior a bit more clearly. diskUrl() is similar in that regard, but that method already has a strict "disk driver has to be 'local'" -- scoped disks never made it through so nothing to change there.
This commit is contained in:
parent
9cda4cb3e4
commit
394a9fa562
1 changed files with 5 additions and 0 deletions
|
|
@ -140,6 +140,11 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
|
||||||
|
|
||||||
protected function diskRoot(string $disk, Tenant|false $tenant): void
|
protected function diskRoot(string $disk, Tenant|false $tenant): void
|
||||||
{
|
{
|
||||||
|
if ($this->app['config']["filesystems.disks.$disk.driver"] === 'scoped') {
|
||||||
|
// Skip scoped disks since they have no root to override
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($tenant === false) {
|
if ($tenant === false) {
|
||||||
$this->app['config']["filesystems.disks.$disk.root"] = $this->originalDisks[$disk]['root'];
|
$this->app['config']["filesystems.disks.$disk.root"] = $this->originalDisks[$disk]['root'];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue