<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Faker\Factory as Faker;

class UserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        DB::table('users')->truncate();

        // Admin User
        DB::table('users')->updateOrInsert(
            ['email' => 'admin@example.com'],  // Jika email ini ada, update datanya
            [
                'name' => 'Admin User',
                'password' => Hash::make('password'),
            ]
        );        

    }
}