mathewparet / laravel-permission-seeder
Permission Seeders for Spatie/Laravel-Permissions
v2.0.7
2023-12-15 14:05 UTC
This package is auto-updated.
Last update: 2024-12-15 16:13:59 UTC
README
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();