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

Sebas10's avatar

There is no role with id `1`.

Buen dia, estoy tratando de asignar roles a usuarios ya registrados, pero cuando ingreso el rol me envia el error Spatie\Permission\Exceptions\RoleDoesNotExist There is no role with id 1. evidentemente ya tengo el rol con id número 1 en la base de datos, no se que pasa :(

también pasa el error si en lugar de asignarle el rol 1 le asignó el rol 2 obviamente el error es: There is no role with id 2.

0 likes
1 reply
SilenceBringer's avatar

@sebas10 the error says - you do not have role with the given id. What explanation do you expect? You do not have this role!

In case of spatie/laravel-permission check also that this role associated with the correct guard

Please or to participate in this conversation.