<?php

namespace Database\Seeders;

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

class DatabaseSeeder extends Seeder
{
    public function run(): void
    {
        // Verificar si ya existe para no duplicar
        if (!User::where('email', 'admin@igpos.com')->exists()) {
            User::create([
                'name' => 'Victor Mendoza',
                'email' => 'victhorinox.123@gmail.com',
                'password' => Hash::make('47781320*'), // Tu contraseña
                'role' => 'admin',
            ]);

            $this->command->info('Usuario Admin creado correctamente.');
        }
    }
}
