Aknaproff/database/seeders/PermissionSeeder.php
2023-09-21 15:01:58 +01:00

21 lines
578 B
PHP

<?php
namespace Database\Seeders;
use App\Enums\User\PermissionEnum;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Permission;
class PermissionSeeder extends Seeder
{
public function run(): void
{
Permission::query()
->upsert([
['name' => PermissionEnum::CREATE_FORM->value, 'guard_name' => 'web'],
['name' => PermissionEnum::VIEW_FORM->value, 'guard_name' => 'web'],
['name' => PermissionEnum::EDIT_FORM->value, 'guard_name' => 'web']
], ['name', 'guard_name']);
}
}