mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 02:04:03 +00:00
get down to 59 phpstan errors
This commit is contained in:
parent
193e044777
commit
a94227a19c
26 changed files with 130 additions and 130 deletions
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
|||
namespace Stancl\Tenancy\Concerns;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Stancl\Tenancy\Database\Models\Tenant;
|
||||
use Stancl\Tenancy\Contracts\Tenant;
|
||||
|
||||
trait DealsWithTenantSymlinks
|
||||
{
|
||||
|
|
@ -23,12 +23,14 @@ trait DealsWithTenantSymlinks
|
|||
$diskUrls = config('tenancy.filesystem.url_override');
|
||||
$disks = config('tenancy.filesystem.root_override');
|
||||
$suffixBase = config('tenancy.filesystem.suffix_base');
|
||||
$symlinks = collect();
|
||||
$tenantKey = $tenant->getTenantKey();
|
||||
|
||||
/** @var Collection<array<string, string>> $symlinks */
|
||||
$symlinks = collect([]);
|
||||
|
||||
foreach ($diskUrls as $disk => $publicPath) {
|
||||
$storagePath = str_replace('%storage_path%', $suffixBase . $tenantKey, $disks[$disk]);
|
||||
$publicPath = str_replace('%tenant_id%', $tenantKey, $publicPath);
|
||||
$publicPath = str_replace('%tenant_id%', (string) $tenantKey, $publicPath);
|
||||
|
||||
tenancy()->central(function () use ($symlinks, $publicPath, $storagePath) {
|
||||
$symlinks->push([public_path($publicPath) => storage_path($storagePath)]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue