<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\User;  // Perhatikan: Model User ada di App\User (bukan App\Models\User)
use Illuminate\Support\Facades\Hash;

class AdminUserSeeder extends Seeder
{
    public function run()
    {
        // Buat super admin
        User::firstOrCreate(
            ['email' => 'superadmin@silaporr.com'],
            [
                'name' => 'Super Admin',
                'password' => Hash::make('password123'),
                'role' => 'super_admin',
                'email_verified_at' => now(),
                'created_at' => now(),
                'updated_at' => now(),
            ]
        );
        
        // Buat admin
        User::firstOrCreate(
            ['email' => 'admin@silaporr.com'],
            [
                'name' => 'Administrator',
                'password' => Hash::make('password123'),
                'role' => 'admin',
                'email_verified_at' => now(),
                'created_at' => now(),
                'updated_at' => now(),
            ]
        );
        
        echo "========================================\n";
        echo "USER ACCOUNTS CREATED SUCCESSFULLY!\n";
        echo "========================================\n";
        echo "1. Super Admin\n";
        echo "   Email: superadmin@silaporr.com\n";
        echo "   Password: password123\n";
        echo "   Role: super_admin\n\n";
        
        echo "2. Administrator\n";
        echo "   Email: admin@silaporr.com\n";
        echo "   Password: password123\n";
        echo "   Role: admin\n";
        echo "========================================\n";
    }
}