<?php

namespace Database\Seeders;

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

class UserSeeder extends Seeder
{
    public function run(): void
    {
        // Jika email sudah ada, dia cuma update password. Kalau belum ada, baru dia bikin baru.
        User::updateOrCreate(
            ['email' => 'admin@gmail.com'],
            ['password' => Hash::make('password123'), 'role' => 'admin']
        );

        User::updateOrCreate(
            ['email' => 'owner@gmail.com'],
            ['password' => Hash::make('password123'), 'role' => 'owner']
        );
    }
}
