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

Improve comments

Correct misleading ones, add ones that were missing (e.g. the TenantAssetController's docblock, the FSBootstrapper dependency should be mentioned there)
This commit is contained in:
lukinovec 2026-08-20 15:32:12 +02:00 committed by Samuel Stancl
parent 15144def3c
commit 1a693d8e36
2 changed files with 18 additions and 6 deletions

View file

@ -331,8 +331,8 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
/**
* Get the storage path of the passed tenant (independent of the current context).
*
* The returned path doesn't depend on suffix_storage_path -- that config option
* only controls whether storage_path() uses it.
* Note that the returned path doesn't depend on suffix_storage_path.
* That config option only affects the storage_path() helper.
*/
public static function getBoundTenantStoragePath(Tenant $tenant): string
{

View file

@ -13,6 +13,13 @@ use Stancl\Tenancy\Bootstrappers\FilesystemTenancyBootstrapper;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Throwable;
/**
* Requires FilesystemTenancyBootstrapper to be enabled, since the assets are served from
* the tenant's storage directory (or from the root of $publicDisk), and neither is
* tenant-specific unless the bootstrapper scopes it.
*
* @see FilesystemTenancyBootstrapper
*/
class TenantAssetController implements HasMiddleware
{
/**
@ -33,6 +40,10 @@ class TenantAssetController implements HasMiddleware
* Disk the assets are served from.
*
* When null, the assets are served from app/public inside the tenant's storage directory.
*
* The disk has to be local and have a root configured, since the assets are read from the filesystem.
* It should also be listed in tenancy.filesystem.disks. FilesystemTenancyBootstrapper only scopes
* the roots of disks listed there, so otherwise every tenant is served the same central directory.
*/
public static string|null $publicDisk = null;
@ -66,11 +77,12 @@ class TenantAssetController implements HasMiddleware
}
/**
* Directory the assets are served from -- the root of the $publicDisk,
* or app/public inside the tenant's storage directory when no disk is configured.
* Directory the assets are served from -- the root of the $publicDisk, or app/public
* inside the tenant's storage directory when no disk is configured. With no current
* tenant (e.g. on a universal route), the central storage directory is used.
*
* The storage directory is resolved using the FilesystemTenancyBootstrapper (rather than
* storage_path(), so that it's tenant-scoped regardless of the suffix_storage_path config).
* The tenant's storage directory is resolved using the FilesystemTenancyBootstrapper (rather
* than storage_path(), so that it's tenant-scoped regardless of the suffix_storage_path config).
*/
protected function assetRoot(): string
{