mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 19:44:04 +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:
parent
4d95e88e27
commit
51228defc6
1 changed files with 2 additions and 3 deletions
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
||||||
namespace Stancl\Tenancy\Bootstrappers;
|
namespace Stancl\Tenancy\Bootstrappers;
|
||||||
|
|
||||||
use Illuminate\Contracts\Foundation\Application;
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
use Illuminate\Filesystem\FilesystemAdapter;
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
|
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
|
||||||
use Stancl\Tenancy\Contracts\Tenant;
|
use Stancl\Tenancy\Contracts\Tenant;
|
||||||
|
|
@ -61,8 +60,8 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
|
||||||
$this->originalPaths['disks'][$disk] = $originalRoot;
|
$this->originalPaths['disks'][$disk] = $originalRoot;
|
||||||
|
|
||||||
$finalPrefix = str_replace(
|
$finalPrefix = str_replace(
|
||||||
'%storage_path%',
|
['%storage_path%', '%tenant%'],
|
||||||
storage_path(),
|
[storage_path(), $tenant->getTenantKey()],
|
||||||
$this->app['config']["tenancy.filesystem.root_override.{$disk}"] ?? '',
|
$this->app['config']["tenancy.filesystem.root_override.{$disk}"] ?? '',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue