Assuming I am building an app in a spa mode with Vue and Laravel via API rest or grpahql
I have the following roles:
Super admin
Admin
Client
Company staff
I got a left menu where items in this menu should be visibles based on roles (and obviously related routes accessible depending on those same roles by following those visibility).
What is the best way to implement this? Vue Auth (e.g websanova) + Laravel Auth (Passport ? Sanctum) ? Vue Auth only ? Laravel Auth only ?
I am a bit confused about what is the most secure way to perform this functionality.
@laurentm Personally I would use Sanctum for your auth layer. It is simple/clean and accounts for authorizing Vue securely as well as a rest API. I admittedly haven't worked with GraphQL much yet, so I would probably stick with Rest. As far as managing user roles/permissions I'd strongly recommend checking out the Spatie package https://spatie.be/docs/laravel-permission/v3/introduction
As far as passing rights back to the interface, I typically would pass values into meta headers, then to state management in Vue, like VueX.
All of this probably sounds more complicated than it really is. The Spatie package is a breeze to learn, just hunt down some youtube vids, you'll see it is pretty simple. Require, run migrations, you'll have access to cool things. All well documented.
If you're not familiar with VueX, I suggest checking out The Net Ninja intro to VueX course. Helped me understand and get a "hello world" up fairly quickly.
Thank you for replying, this is the information i was missing: "As far as passing rights back to the interface, I typically would pass values into meta headers, then to state management in Vue, like VueX."