Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bogdy's avatar
Level 10

There is no role named `User`. Spatie Permission

I use the package laravel-permission from spatie. I try to associate users with roles and permissions. I followed the documentation step by step. I get two kinds of errors.

When a asociate a user with roles. I get

There is no role named `User`.

When a asociate a permission to user. I get for Example

There is no permission named `writer` for guard `web`.

The roles and Permission exist. Does anyone have any advice?

0 likes
2 replies
bogdy's avatar
Level 10

@Nakov lower case did not resolve but I I think it has to do with guard name. the admin role is add with the seeder and the guard name is web and the other roles and permission that I create has guard name sanctum.

Please or to participate in this conversation.