<?php

namespace Database\Seeders;

use App\Models\Department;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;

class DepartmentSeeder extends Seeder
{
    public function run(): void
    {
        $departments = [
            ['name' => 'Finance',   'slug' => 'finance'],
            ['name' => 'Operation', 'slug' => 'operation'],
        ];

        foreach ($departments as $data) {
            Department::updateOrCreate(
                ['slug' => $data['slug']],
                [
                    'name'      => $data['name'],
                    'is_active' => 1,
                    'icon'      => null,
                ]
            );
        }
    }
}

