Cache Related Question #2497
Answered
by
drbyte
deep-codepaper
asked this question in
Q&A
Replies: 1 comment
-
Since you bypassed the internal api by running direct db queries, you need to manually clear the cache.
See https://spatie.be/docs/laravel-permission/v5/advanced-usage/cache
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
drbyte
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it considered a good idea to implement caching for permissions while syncing data to roles?
Allow me to provide an example.
Suppose I've added some permissions but forgot to include my custom guard_name. In response, I make changes to the permissions via a SQL query in the database, updating the guard_name for all permissions. However, when I attempt to syncPermissions, an error arises because it appears that there are no permissions associated with my custom guard_name, possibly due to caching.
I would appreciate your input on whether this approach is acceptable to everyone.
Beta Was this translation helpful? Give feedback.
All reactions