<?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([
            TeamSeeder::class,
            BadgeSeeder::class,
        ]);

        // Default admin account for the web admin panel (/admin)
        User::firstOrCreate(
            ['email' => 'admin@matchday.test'],
            [
                'name'     => 'Admin',
                'username' => 'admin',
                'email'    => 'admin@matchday.test',
                'password' => Hash::make('password'),
                'is_admin' => true,
            ]
        );
    }
}
