<?php

namespace Database\Seeders;

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

class AdminSeeder extends Seeder
{
    public function run(): void
    {
        User::updateOrCreate(
            ['email' => 'admin@classtrack.edu'],
            [
                'name'              => 'Super Admin',
                'username'          => 'admin',
                'email'             => 'admin@classtrack.edu',
                'phone'             => '+880 1711-000000',
                'designation'       => 'Super Admin',
                'password'          => Hash::make('admin123'),
                'password_plain'    => 'admin123',
                'access_code'       => Hash::make('AC-2024-7731'),
                'access_code_plain' => 'AC-2024-7731',
                'role'              => 'super_admin',
                'is_active'         => true,
            ]
        );
    }
}
