<?php

namespace Database\Seeders;

use App\Models\User;
use Illuminate\Database\Seeder;

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

        User::updateOrCreate(
            ['email' => env('ADMIN_EMAIL', 'admin@studyflash.local')],
            [
                'name' => 'Admin',
                'password' => env('ADMIN_PASSWORD', 'Admin1234!'),
                'role' => 'admin',
                'is_active' => true,
            ]
        );

        User::updateOrCreate(
            ['email' => env('DEMO_EMAIL', 'demo@studyflash.local')],
            [
                'name' => 'Démo',
                'password' => env('DEMO_PASSWORD', 'demo1234'),
                'role' => 'user',
                'is_active' => true,
            ]
        );
    }
}
