<?php

namespace Database\Seeders;

use App\Models\User;
use App\Models\Course;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        User::create([
            'login' => 'Admin',
            'email' => 'admin@example.com',
            'full_name' => 'Администратор',
            'phone' => '8(999)111-11-11',
            'password' => Hash::make('KorokNET'),
        ]);

        User::create([
            'login' => 'test',
            'email' => 'test@example.com',
            'full_name' => 'тестовый пользователь',
            'phone' => '8(999)111-11-11',
            'password' => Hash::make('password'),
        ]);

        $courses = [
            [
                "name" => 'Алгоритмизация',
                "description" => 'Алгоритмизация',
                "price" =>  15000,
            ],
            [
                "name" => 'Базы данных',
                "description" => 'Базы данных',
                "price" =>  15000,
            ],
            [
                "name" => 'дизайн',
                "description" => 'дизайн',
                "price" =>  15000,
            ],
        ];

        foreach ($courses as $course) {
            Course::create($course);
        }
    }
}
