<?php

namespace Database\Seeders;

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

class UserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $admin = User::create([
            'name' => 'Admin',
            'username' => 'admindlh25',
            'email' => 'dlh@gmail.com',
            'password' => Hash::make('admindlh25'),
        ]);

        $admin->assignRole('admin');

        $user = User::create([
            'name' => 'Uji Coba',
            'username' => 'ujicoba25',
            'email' => 'ujicoba@gmail.com',
            'password' => Hash::make('ujicoba25'),
        ]);

        $user->assignRole('user');
    }
}
