Example of implementation of roles and permissions in laravel using the laravel-authorization package
1. Clone the repository
git clone https://github.com/eneav/laravel-authorization-example.git2. Install dependencies
cd laravel-authorization-example
composer installIf the .env file is not generated, it must be generated
cp .env.example .env
php artisan key:generate3. Create a database
mysql> create database authorization_example;4. Configure database credentials
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=authorization_example
DB_USERNAME=root
DB_PASSWORD=
5. execute the migrations and seeders
php artisan migrate --seed6. Turn on the server
php artisan serve| Username | Password | Permissions | Roles |
|---|---|---|---|
| hello@enea.io | nano | * | Admin |
| editor@enea.io | nano | mofidy-articles | |
| creator@enea.io | nano | create-articles | |
| destroyer@enea.io | nano | destroy-articles |