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

fix: fixes custom disk file url for non-root_override disks

Before:
Storage::disk('branding')->url('logo.png') returns 'storage/logo.png'

After:
Storage::disk('branding')->url('logo.png') returns 'storage/tenant1/logo.png'
This commit is contained in:
Suraj Dadral 2023-05-30 12:06:23 +05:30
parent d9b7107900
commit db4aec7771
No known key found for this signature in database
GPG key ID: 6514A44D0BD0E5D3

View file

@ -72,6 +72,11 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
}
$this->app['config']["filesystems.disks.{$disk}.root"] = $finalPrefix;
if (!isset($this->app['config']["tenancy.filesystem.root_override.{$disk}"])) {
$originalUrl = $this->app['config']["filesystems.disks.{$disk}.url"];
$this->app['config']["filesystems.disks.{$disk}.url"] = $originalUrl ? rtrim($originalUrl, '/') . '/'. $suffix : $suffix;
}
}
}