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

mittalkhuthiya's avatar

Authentication and authorization

Hi, I read many aritcles and saw many packages available for authorization and authentication both But as starter i got confused which would best to implement I Have 10 different roles and user can have multiples roles

Authentication saw breeze , Jetstream Authorization laracast,Senitel, Spatie this all made me confused which one i should use

Please if any one can give insight on same thanks in advance

0 likes
2 replies
Snapey's avatar

you can do authorisation with no packages, but the spatie package allows you to store roles and permissions in the database so that you can dynamically assign roles and permissions in your application. For example, one user can decide that another user should be an admin

Spatie permissions also maps roles to permissions so you could in your code say that to edit a post you must have 'post.edit' permission. The 'admin' role has that permission as does the 'editor' role. You can give people roles and the role gives them permission to do certain actions

johnDoe220's avatar

I think Laravel / UI is very practical and great

composer require laravel/ui

Please or to participate in this conversation.