You can handle the exceptions manually: https://spatie.be/docs/laravel-permission/v5/advanced-usage/exceptions
Apr 9, 2023
3
Level 3
Auth Exception
i am building api with laravel and i am using spatie for roles and permission , the problem is that spatie when the user doesn't have the right role, the it return html page 403 not json message, what should i do?
Please or to participate in this conversation.