JosephSilber/bouncer

Is there any way to refresh() cache for all tenants

Opened this issue · 0 comments

I'm using tenant_id for scopes in the middleware (Laravel application).

Currently, when refreshing the cache using Bouncer::refresh(), it refreshes for the users in the current tenant scope only.
To refresh for all the users in each tenant, I have to iterate it something like below:

foreach $tenants as $tenant) {
    Bouncer::scope()->to($tenant->id);
    Bouncer::refresh();
}

Is there any way to refresh the cache for all users regardless of the scope?

Or is there any chance to configure a default time for the cache such as 24hrs?