You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default this package has set cache time for 1 minute. If I update permissions for a role, this will be effective in next cache interval. But there's should be an option to manually invalidate the cache.
The text was updated successfully, but these errors were encountered:
apuatcfbd
changed the title
No way to invalidate cache
No way to invalidate cache manually
Mar 8, 2021
As there's no way to invalidate cache, I've created a trait to do so . Don't know if the keys I'm passing is absolutely correct or not. But it's working.
namespace App\Traits;
use Illuminate\Support\Facades\Cache;
trait AclCache
{
public function invalidatePermissionCache(int $roleId) :void
{
Cache::forget("acl.getPermissionsInheritedById_{$roleId}");
Cache::forget("acl.getPermissionsById_{$roleId}");
Cache::forget("acl.getMergeById_{$roleId}");
}
public function invalidateRoleCache(int $userId) :void
{
Cache::forget("acl.getRolesById_{$userId}");
}
}
By default this package has set cache time for 1 minute. If I update permissions for a role, this will be effective in next cache interval. But there's should be an option to manually invalidate the cache.
The text was updated successfully, but these errors were encountered: