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

Set root in config() too

This commit is contained in:
Samuel Stancl 2020-07-14 19:51:11 +02:00 committed by GitHub
parent df4d7288d7
commit aee2a2e567
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;
}
}
}