mirror of
https://github.com/archtechx/tenancy.git
synced 2026-09-20 13:54:03 +00:00
Make DeleteTenantStorage delete the tenant storage directory regardless of suffix_storage_path
The job depended on storage_path(), which is only suffixed when suffix_storage_path is enabled, so with it disabled the tenant's files were left behind. It now uses the bootstrapper's own suffix logic via a new getBoundTenantStoragePath() method..
This commit is contained in:
parent
3cc7902377
commit
0bd58528d2
2 changed files with 26 additions and 13 deletions
|
|
@ -327,4 +327,17 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
|
|||
{
|
||||
return app(static::class)->originalStoragePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the storage path of the passed tenant (independent of the current context).
|
||||
*
|
||||
* This is the directory the bootstrapper scopes disks, cache and sessions to,
|
||||
* regardless of suffix_storage_path (that config option only affects the storage_path() helper).
|
||||
*/
|
||||
public static function getBoundTenantStoragePath(Tenant $tenant): string
|
||||
{
|
||||
$bootstrapper = app(static::class);
|
||||
|
||||
return $bootstrapper->tenantStoragePath($bootstrapper->suffix($tenant));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue