<?php

namespace Database\Seeders;

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

class UserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $users = [
            [
                'id' => 67,
                'name' => 'Goran',
                'email' => 'poptech@gmail.com',
                'email_verified_at' => Carbon::now(),
                'password' => Hash::make('@Lenna3001'),
            ],
            [
                'id' => 99,
                'name' => 'Goran',
                'email' => 'poptech@protonmail.com',
                'email_verified_at' => Carbon::now(),
                'password' => Hash::make('@Lenna3001'),
            ],
        ];

        foreach ($users as $key => $value) {
            $user = User::create($value);
            $user->roles()->sync(1);
        }
        $user = User::where('id', 67)->first();
        $user->roles()->sync([1, 4, 7, 11]);
    }
}
