Aknaproff/database/seeders/PermissionSeeder.php

21 lines
578 B
PHP
Raw Normal View History

2023-09-21 14:01:58 +00:00
<?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']);
}
}