Anyone can guide me that how to write an API for Roles and permission using Spatie (Laravel)p
add this to your user model: use HasRoles, HasPermissions; this would add the basic role/perms from spatie
then add protected $with = ['roles', 'permissions'];
it will autoload the values
then in your UserController, just return user object
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community