Aknaproff/database/seeders/RoleSeeder.php

21 lines
526 B
PHP
Raw Normal View History

2023-09-21 14:01:58 +00:00
<?php
namespace Database\Seeders;
use App\Enums\User\RoleEnum;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Role;
class RoleSeeder extends Seeder
{
public function run(): void
{
Role::query()
->upsert([
['name' => RoleEnum::SUPERVISOR->value, 'guard_name' => 'web'],
['name' => RoleEnum::ADMIN->value, 'guard_name' => 'web'],
['name' => RoleEnum::USER->value, 'guard_name' => 'web']
], ['name', 'guard_name']);
}
}