From 9e890e9a67732b0efcdcfbc4f67dcb2f76cd8801 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Thu, 10 Sep 2026 12:32:14 +0200 Subject: [PATCH] Improve symlink comments Make it clear that both diskRoot and publicPath get the same prefix appended. In the possibleTenantSymlinks() docblock, correct the array example (the values are not just 'disk root' anymore -- if the disk has a prefix, it will be appended to the configured root). --- src/Concerns/DealsWithTenantSymlinks.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Concerns/DealsWithTenantSymlinks.php b/src/Concerns/DealsWithTenantSymlinks.php index 3bb267c8..a53c2e51 100644 --- a/src/Concerns/DealsWithTenantSymlinks.php +++ b/src/Concerns/DealsWithTenantSymlinks.php @@ -16,7 +16,7 @@ use Stancl\Tenancy\Contracts\Tenant; trait DealsWithTenantSymlinks { /** - * Get all possible tenant symlinks, existing or not (array of ['public path' => 'disk root']). + * Get all possible tenant symlinks, existing or not (array of ['public path' => 'disk root with the disk's prefix appended']). * * Tenants can have a symlink for each local disk that is listed * in both tenancy.filesystem.disks and tenancy.filesystem.url_override. @@ -61,9 +61,11 @@ trait DealsWithTenantSymlinks $diskRoot = $tenantDisks[$disk]['root']; if ($prefix = trim($disks[$disk]['prefix'] ?? '', '/\\')) { + // Append the disk's prefix to the disk root $diskRoot = rtrim($diskRoot, '/\\') . DIRECTORY_SEPARATOR . $prefix; - // Storage::url() appends the disk's prefix to the url, so the prefix has to be in the public path as well + // Append the same prefix to the public path. + // Storage::url() appends the disk's prefix to the url, so the prefix has to be in the public path as well. $publicPath .= DIRECTORY_SEPARATOR . $prefix; }