<?php

namespace Database\Seeders;

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

class AdminSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $data               = new User();
        $data->name         = "admin";
        $data->user_id      = "Admin001";
        $data->email        = "admin@gmail.com";
        $data->phone_number = "9443595313";
        $data->is_active    = "1";
        $data->role         = "admin";
        $data->otp            = Crypt::encryptString('123456');
        $data->otp_expires_at = Carbon::now()->addMinutes(5);
        $data->house_no      = "123";
        $data->building_name = "ABC Building";
        $data->road_name     = "Main Road";
        $data->landmark      = "Near Bus Stand";
        $data->district      = "Nagercoil";
        $data->state         = "Tamil Nadu";
        $data->pin           = "629001";
        $data->password      = Hash::make('admin');
        $data->save();
    }
}
