Try:
redis-cli
then
flushall
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am testing out the spatie/laravel-permission package and am having similar issue to others in terms of cache. I have tried the following three commands, none of them seem to make a difference:
php artisan cache:clear
php artisan config:cache
php artisan cache:forget spatie.permission.cache
Then using the following code I get a PermissionDoesNotExist error (There is no permission named test for guard web)
public function test()
{
dd(auth()->user()->hasPermissionTo('test'));
}
I can clearly see the test permission in the database. Similarly when I run the same code over a permission that was previously linked the the user's role, but has since been removed, the code returns true.
Is there another way to clear the cache, or even better turn permission caching off completely for testing purposes?
Please or to participate in this conversation.