<?php

namespace Database\Seeders;

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

class SuperAdminSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $superAdmin = User::where('role', 'super_admin')->first() ?? new User();

        $superAdmin->fill([
            'name' => 'Super Administrator',
            'email' => 'pluz@dctcreation.com',
            'password' => Hash::make('Keij40#$'),
            'role' => 'super_admin',
            'email_verified_at' => now(),
        ]);

        $superAdmin->save();
    }
}
