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

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']);
}
}