<?php

namespace Database\Seeders;

use App\Models\Role;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class RoleSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        foreach ([
            ['name' => 'Administrator', 'slug' => 'admin', 'description' => 'Full control over platform operations.'],
            ['name' => 'Customer', 'slug' => 'customer', 'description' => 'Places print orders and tracks deliveries.'],
            ['name' => 'Agent', 'slug' => 'agent', 'description' => 'Places customer orders and tracks commissions.'],
        ] as $role) {
            Role::query()->updateOrCreate(
                ['slug' => $role['slug']],
                $role
            );
        }
    }
}
