Laravel 5 provides authentication to us but that it simple to get user register, login, logout, and reset password and run quickly and easily. Laravel 5 give you simple authentication and it's fast and it's consider to all developer requirement.
But if you are work on big ERP or Project then you need to control access to certain sections of the website. I mean you require to role permissions based access control database design that way you can specify level of user.
Roles and Permissions through you can create several types of users with different role and permission, i mean some user have only see listing of items module, some user can also edit items modules, for delete and etc.
So if you also want to build ACL(Access Control List) based on Roles and Permissions with Middleware then you can do it simple by following few step. In this tutorial i give you very simple step to create ACL from scratch using entrust package, it is provides lots of method to check permission and roles, so no worry if you don't know more laravel.
In this examples i created three modules as listed bellow:
User Management
Role Management
Item CRUD Management
After registration, you don't have any roles, so you can edit your details and assign admin role to you from User Management. After that you can create your own role with permission like role-list, role-create, role-edit, role-delete, item-list, item-create, item-edit, item-delete. you can check with assign new user and check that.
After complete you can see as bellow perview:
Preview:

role based access control database design, user role permission laravel, laravel role and permission, laravel 5 user roles and permissions, laravel 5.2 permissions, laravel 5 roles and permissions tutorial, laravel 5 entrust middleware, zizaco entrust laravel 5, entrust laravel 5 tutorial, laravel roles tutorial, laravel user roles tutorial, laravel acl roles and permissions
Step 1: Laravel Installation
If you haven't installed laravel in your system then you can run bellow command and get fresh Laravel project.
composer create-project --prefer-dist laravel/laravel blog
After clone laravel application, we also require to install laravelcollective/html for Form class, you can install from here : HTML/FORM not found in Laravel 5?.
Step 2: Package Installation
Now we require to install entrust package for ACL, that way we can use it's method. So Open your terminal and run bellow command.
composer require zizaco/entrust:5.2.x-dev
Now open config/app.php file and add service provider and aliase.
'providers' => [....
'Zizaco\Entrust\EntrustServiceProvider::class',
],
'aliases' => [
....
'Entrust' => Zizaco\Entrust\EntrustFacade::class,
],
Config
We can also custom changes on entrust package, so if you also want to changes then you can fire bellow command and get config file in config/entrust.php.
php artisan vendor:publish
Step 3: Create Table using Migration
In this step we have to create five tables as listed bellow :
1.users
2.items
3.roles
4.role_user
5.permission_role
So, if you install fresh project then you have already users table migration but if you don't have items table, so can create manually and other table can create using entrust package command, so run bellow command and check migration file also.
php artisan make:migration create_items_table
php artisan entrust:migration
User table Migration