apiary
apiary copied to clipboard
Flush cached permissions when roles/permissions are attached/detached from users
@evan10s can you add relevant snippets here please
https://gist.github.com/evan10s/835cbdf57e72120d978adf77e65039b7
Most of this is borrowed from StackOverflow, it's not really anything special. Make sure to use the modified HasRolesTrait
(not sure why trait is in the name, but) on the User model.
Hm that's more complicated than i expected. Need to check how the nova package modifies roles, i vaguely recall it being a direct DB write.
https://laravel-news.com/laravel-model-caching
https://matthewdaly.co.uk/blog/2018/01/12/creating-a-caching-user-provider-for-laravel/