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