Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attaching Permission to Role does not refresh cached permissions #949

Open
disljenko opened this issue Jun 6, 2019 · 3 comments
Open

Attaching Permission to Role does not refresh cached permissions #949

disljenko opened this issue Jun 6, 2019 · 3 comments

Comments

@disljenko
Copy link

disljenko commented Jun 6, 2019

I'm using Laravel 5.8 and package version "zizaco/entrust": "5.2.x-dev". When attaching permission to role in the way shown below cache is not updated until i fire: "php artisan cache:clear"
For Caching i'm using redis.
I have other Laravel project v5.6 and everything just work fine.

$role = Role::find($role_id);
$role->attachPermission($permission);

@JackDPro
Copy link

And i change role_user table data manually , it not work.

@JackDPro
Copy link

Add Cache::tags(config('entrust.role_user_table'))->flush(); to your code where attaching permission or detach permission, the cache will refresh. @disljenko . It works to me.

@collectiveThinking
Copy link

thanks @dongkaipo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants