Laravel Community Tools by Tighten

laraveltricksmember

Joined: 8 years ago
Total tricks: 1
Last trick: 8 years ago

Submitted tricks

This is a simple solution to create ACL using middleware and role ID. Please follow step by step as shown below. <br> <br>1) create column group_id (int) at users table. <br> <br>2) give value on that column | group_id values: | 1 = Admin | 2 = HR | 3 = Staff 3) create new middleware using php artisan php artisan make:middleware Role 4) Edit the middleware file 5) Edit kernel file and put another line for role class. 6) Set the route and put the role id which allow it to access
laraveltri... 8 years ago 7158
5.0