@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
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
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.
Please or to participate in this conversation.