<?php

namespace Database\Seeders;

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

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        if(User::query()->get()->count() < 1) {
            User::create([
                'name'  => 'Администратор СМЕНИ ПАРОЛЬ!',
                'email' => 'admin@admin.com',
                'role'  => 'admin',
                'password' => Hash::make('admin')
            ]);
        }

        $this->call(DistrictSeeder::class);
        $this->call(AreaSeeder::class);
        $this->call(ObjectTypeSeeder::class);
        $this->call(OrderStatusSeeder::class);
        $this->call(BrigadierSeeder::class);
    }
}
