<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\User;
use Illuminate\Support\Facades\Hash;

class UserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // Admin Account
        User::firstOrCreate([
            'email' => 'admin@warkopcakimin.com',
        ], [
            'name' => 'Admin Warkop',
            'password' => Hash::make('password'),
            'role' => 'admin',
            'branch' => null,
        ]);

        // Employee Cabang 1
        User::firstOrCreate([
            'email' => 'karyawan1@warkopcakimin.com',
        ], [
            'name' => 'Karyawan 1',
            'password' => Hash::make('password'),
            'role' => 'karyawan',
            'branch' => 'Cabang 1',
        ]);

        
        // Employee Cabang 2
        User::firstOrCreate([
            'email' => 'karyawan2@warkopcakimin.com',
        ], [
            'name' => 'Karyawan 2',
            'password' => Hash::make('password'),
            'role' => 'karyawan',
            'branch' => 'Cabang 2',
        ]);

        // Employee Cabang 3
        User::firstOrCreate([
            'email' => 'karyawan3@warkopcakimin.com',
        ], [
            'name' => 'Karyawan 3',
            'password' => Hash::make('password'),
            'role' => 'karyawan',
            'branch' => 'Cabang 3',
        ]);
    }
}
