<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('forgot_code')->nullable();
            $table->string('password');
            $table->string('permission')->default('staff');
            $table->rememberToken();
            $table->timestamps();
        });

        DB::table('users')->insert([
            [
                'name' => 'BIEN CONG NHUT TRUONG',
                'email' => 'roger.b@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'PHAN QUOC BAO',
                'email' => 'ryder.ph@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'PHAM VAN HUYNH',
                'email' => 'jon.ph@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'VO MINH TRUONG',
                'email' => 'vincent.vo@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'NGUYEN HUU PHUC',
                'email' => 'jason.ng@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'NGUYEN VO TINH',
                'email' => 'alex.ng@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'DANG TRUNG KIEN',
                'email' => 'kevin.dang@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'HUYNH THI HONG GAM',
                'email' => 'rose.h@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'NGUYEN TRUNG THAT',
                'email' => 'andrew.ng@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'LE TAN LUAN',
                'email' => 'joseph.le@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'VO VAN MINH',
                'email' => 'michael.vo@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'TON GIA KHANH',
                'email' => 'kai.t@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'PHAM QUOC HY',
                'email' => 'asher.ph@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            [
                'name' => 'Admin',
                'email' => 'admin@apactech.io',
                'password' => bcrypt('Work1234'),
            ],
            
        ]);
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('users');
    }
};
