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

vincent15000's avatar

Spatie laravel-permission

Hello,

I have a project where I have to manage some permissions.

For example : an app with recipes, the recipes are organized by categories and a member connects and pay to access only some categories.

I had a look at the spatie package, but I'm not sure to understand all what it offers.

Would the spatie package be a solution to my problem ?

Thanks for your answer ;).

Vincent

0 likes
8 replies
jlrdw's avatar

Spatie still uses laravel authorization. Just makes it easier. I'd suggest explore their documentation and try some examples.

1 like
vincent15000's avatar

@jlrdw ok si if I already use policies the spatie package does not offer a really better way to manage rights or ?

Griehle's avatar

Yes. Spatie package would do exactly what you are after. I have used it to make fairly complex user/profile combinations with different Permissions that allow various levels of access.

1 like
Snapey's avatar
Snapey
Best Answer
Level 122

You can do a lot with Authorization that is already a feature of Laravel framework

1 like
vincent15000's avatar

@Snapey yes thanks you I usually use policies to manage the authorizations, but I have never tried the spatie package, so I try to know if it is really relevant to use it if I already do good things with the Laravel base functionalities

Snapey's avatar

@vincent15000 its of most use if you have users with different ROLES and each role having a different set of PERMISSIONS

If you don't want roles, then no need for this package

1 like
vincent15000's avatar

@Snapey ok ... well ...

Imagine some recipes in categories, user 1 is a member and has only access to categories 1 and 3 and user 2 is a member and has only access to categories 1, 2 and 4.

I never had to manage a project with such permissions / roles ... what I need is that different members (with the role "member") can have different permissions ... A use (some admin) can be able to save these permissions (via a form) for other others. The aim is to filter which recipes are visible / hidden for each user.

I already have some idea how I can implement this with the policies ... I just wonder if the spatie package really have something so interesting that it would be shame not to use it to implement such permissions.

Please or to participate in this conversation.