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

yidekoh556's avatar

Is laravel's ACL good enough for Authentication and Authorization?

Is laravel's ACL good enough for Authentication and Authorization? Do I need third-party packages for advanced ACL features?

0 likes
3 replies
lostdreamer_nl's avatar

That depends on how you want to use authorization.

For authentication it's perfect as is (making sure someone is who they say they are, ie: logging in).

For Authorization (who can do what) you have a lot of possibilities:

You can use the Policies: https://laravel.com/docs/5.6/authorization This is very extensible, for instance: you could easily set it up so that a user can edit their own posts, unless they have the role 'admin' then the can edit any post, or if they are role 'manager', they can only edit their own posts and those of their employees.

You could go the ACL way using User --> Roles --> Permissions models (has to be setup manually)

There are a lot of possibilities and Laravel will not force you to use one over another.

yidekoh556's avatar

@lostdreamer_nl . Thanks, does that mean I can use ACL Concepts of Laravel to build even advanced role based System without any plug-ins?

lostdreamer_nl's avatar
Level 53

yes ofcourse, I do it all the time:

  • Create a Role model (User hasOne / hasMany Roles)
  • Create a Permission model (Role hasMany Permission) add any permissions your system might need and have your controllers check these permissions ($user->can('post.edit', $post))
  • Either use the Policy classes or setup your own can() method on the user model to check if the user (via it's roles) has this permission.

Please or to participate in this conversation.