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

LaraBABA's avatar

Roles and permissions Laravel API - How?

Hello,

I would like to know what is the best way to have role and permissions in the Laravel API using the passport please. I would like to use Vue with it but I am not sure how to check the role of a user with VUE and the best way to set roles in the API itself.

I did set roles in the API in the past but used a middleware, is there a better of doing this? Perhaps a way for the spatie plugin to be used in the API itself? I cannot find a good article on this on the net.

Thank you.

0 likes
1 reply

Please or to participate in this conversation.