<?php

namespace Database\Seeders;

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

class DatabaseSeeder extends Seeder
{
    public function run(): void
    {
        $this->call(RolesSeeder::class);

        $admin = User::firstOrCreate(
            ['email' => 'admin@biosupplyuk.com'],
            [
                'name' => 'BioSupply Admin',
                'password' => Hash::make('admin123!'),
                'date_of_birth' => '1990-01-01',
                'age_verified_at' => now(),
                'email_verified_at' => now(),
            ]
        );
        $admin->assignRole('admin');
    }
}
