<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\Master\Group;

class GroupSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $group = [
            ['name' => 'Administrator','alias' => 'administrator'],
            ['name' => 'Admin TL','alias' => 'admin'],
            ['name' => 'Lembaga / Badan Pemerintah Daerah','alias' => 'lembaga-daerah'],
            ['name' => 'Lembaga Non-Kementerian / Badan Nasional','alias' => 'badan-nasional'],
            ['name' => 'Biro / Sekretariat / Unit Pelayanan','alias' => 'biro'],
            ['name' => 'Kementerian / Lembaga Pemerintah Pusat','alias' => 'kementrian'],
        ];

        foreach($group as $valGroup){
            Group::updateOrCreate([
                'name' => $valGroup['name'],
                'alias' => $valGroup['alias'],
            ],[
                'name' => $valGroup['name'],
                'alias' => $valGroup['alias'],
                'status' => 1,
            ]);
        }
    }
}
