<?php

namespace Database\Seeders;

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

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        $password = env('SEED_OWNER_PASSWORD', 'ChangeMe!Owner1');

        User::query()->updateOrCreate(
            ['email' => 'owner@sysorder.local'],
            [
                'name' => 'Owner',
                'password' => Hash::make($password),
                'email_verified_at' => now(),
            ]
        );
    }
}
