laravel-permission-seeder maintained by mathewparet
Description
Permission Seeders for Spatie/Laravel-Permissions
Author
Last update
2023/12/15 15:05
(dev-master)
License
Downloads
291
mathewparet/laravel-permission-seeder
A seeder helper to create and remove permissions.
Installation
composer require mathewparet/laravel-permission-seeder
Usage
To create a permission seeder:
php artisan make:permission-seeder User UserPermissionSeeder
To create permissions along with migration, add this to the up() function in the migration:
UserPermissionSeeder::seed();
Similarly, to remove permissions while rolling back a migration, add this to the down() function in the migration:
UserPermissionSeeder::unseed();