Change the cache key call to a static property

This commit is contained in:
Chris Blackwell 2024-08-07 09:10:31 -04:00 committed by GitHub
parent f5eb95e16b
commit a28b5675ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,14 +35,14 @@ Next, add the following listeners to the `TenancyBootstrapped` and `TenancyEnde
Events\TenancyBootstrapped::class => [ Events\TenancyBootstrapped::class => [
function (Events\TenancyBootstrapped $event) { function (Events\TenancyBootstrapped $event) {
$permissionRegistrar = app(\Spatie\Permission\PermissionRegistrar::class); $permissionRegistrar = app(\Spatie\Permission\PermissionRegistrar::class);
$permissionRegistrar->cacheKey = 'spatie.permission.cache.tenant.' . $event->tenancy->tenant->getTenantKey(); $permissionRegistrar::$cacheKey = 'spatie.permission.cache.tenant.' . $event->tenancy->tenant->getTenantKey();
} }
], ],
Events\TenancyEnded::class => [ Events\TenancyEnded::class => [
function (Events\TenancyEnded $event) { function (Events\TenancyEnded $event) {
$permissionRegistrar = app(\Spatie\Permission\PermissionRegistrar::class); $permissionRegistrar = app(\Spatie\Permission\PermissionRegistrar::class);
$permissionRegistrar->cacheKey = 'spatie.permission.cache'; $permissionRegistrar::$cacheKey = 'spatie.permission.cache';
} }
], ],
``` ```