mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 12:34:03 +00:00
[4.x] Filesystem bootstrapper: scoped disk support (#1402)
Fixes #1401 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: lukinovec <lukinovec@gmail.com> Co-authored-by: Samuel Stancl <samuel@archte.ch>
This commit is contained in:
parent
7955aae6d5
commit
3c0e21b726
3 changed files with 50 additions and 2 deletions
|
|
@ -114,7 +114,18 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
|
|||
|
||||
protected function forgetDisks(): void
|
||||
{
|
||||
Storage::forgetDisk($this->app['config']['tenancy.filesystem.disks']);
|
||||
$tenantDisks = $this->app['config']['tenancy.filesystem.disks'];
|
||||
$scopedDisks = [];
|
||||
|
||||
foreach ($this->app['config']['filesystems.disks'] as $name => $disk) {
|
||||
if (isset($disk['driver'], $disk['disk'])
|
||||
&& $disk['driver'] === 'scoped'
|
||||
&& in_array($disk['disk'], $tenantDisks, true)) {
|
||||
$scopedDisks[] = $name;
|
||||
}
|
||||
}
|
||||
|
||||
Storage::forgetDisk(array_merge($tenantDisks, $scopedDisks));
|
||||
}
|
||||
|
||||
protected function diskRoot(string $disk, Tenant|false $tenant): void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue