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

[3.x][Filesystem] Provide an additional argument for tenant name path (#817)

* Let the user pass the tenant suffix by %tenant%

In this PR we let the user pass an additional parameter using `%tenant%` so the user can additionally pass the folder corresponding to each tenant.
This is my proposal, because if I try to use %storage_path% within Linux, I get the full path to the project when I use Google Cloud Storage

* Missing missing updates

Moving from $subject to $root when %storage_path% has been replaced
This commit is contained in:
Vincent GS 2022-05-26 04:51:27 -05:00 committed by GitHub
parent 4d95e88e27
commit 51228defc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,6 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Bootstrappers;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Support\Facades\Storage;
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
use Stancl\Tenancy\Contracts\Tenant;
@ -61,8 +60,8 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
$this->originalPaths['disks'][$disk] = $originalRoot;
$finalPrefix = str_replace(
'%storage_path%',
storage_path(),
['%storage_path%', '%tenant%'],
[storage_path(), $tenant->getTenantKey()],
$this->app['config']["tenancy.filesystem.root_override.{$disk}"] ?? '',
);