<?php

namespace Database\Seeders;

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

class AdminSeeder extends Seeder
{
    public function run(): void
    {
        $email = env('ADMIN_EMAIL', 'Imanoel@gmail.com');
        $password = env('ADMIN_PASSWORD', 'imanoel123');

        if (!Admin::where('email', $email)->exists()) {
            Admin::create([
                'name' => 'Administrator',
                'email' => $email,
                'password' => Hash::make($password),
            ]);
        }
    }
}
