Skip links

Creating roles & permissions in Laravel using Spatie Laravel Permissions

By following this quick tutorial, you will be able to create Permissions in laravel.

Spatie Laravel Permissions Documetation Page – View Documetation

Steps to follow

Step 1: Install laravel-permission package to your laravel installation.

 composer require spatie/laravel-permission

Step 2: Update Providers list in app/config.php

'providers' => [
    // ...
    Spatie\Permission\PermissionServiceProvider::class,
];

Step 3: Publish migrations

php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"

Step 5: Clear Caches

 php artisan optimize:clear
 # or
 php artisan config:clea

Step 6: Publish Migrations

 php artisan migrate

Leave a comment