21 lines
578 B
PHP
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']);
|
|
}
|
|
}
|