Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer. You can expect quick tips, links to interesting tutorials, opinions and packages. Want to learn the cool stuff? Then sign up now!

How to build screens for users, permissions and roles in a Laravel app

One of our more popular packages is laravel-permission. It enables you to easily save roles and permissions in the database. It hooks into Laravel’s native authorization capabilities. Allthough it’s quite powerful, the package doesn’t come with any UI out of the box.

If you do need a UI for this in your projects you’re in luck. On Scotch.io Caleb Oki wrote down an extensive tutorial on how you can build screens to manage users, permissions and roles that use our package.

When building an application, we often need to set up an access control list (ACL). An ACL specifies the level of permission granted to a user of an application. For example a user John may have the permission to read and write to a resource while another user Smith may have the permission only to read the resource.

In this tutorial, I will teach you how to add access control to a Laravel app using laravel-permission package. For this tutorial we will build a simple blog application where users can be assigned different levels of permission.

https://scotch.io/tutorials/user-authorization-in-laravel-54-with-spatie-laravel-permission

Freek Van der Herten is a partner and developer at Spatie, an Antwerp based company that specializes in creating web apps with Laravel. After hours he writes about modern PHP and Laravel on this blog. When not coding he’s probably rehearsing with his kraut rock band.