<?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      = "AD1234";
        $data->email        = "ansalnaans2002@gmail.com";
        $data->phone_number = "9443595313";
       
        $data->is_active    = "1";
        $data->role         = "admin";
        // $data->otp                  = "123456";
        // $data->otp_expires_at       = "";
        $data->otp            = Crypt::encryptString('123456');
        $data->otp_expires_at = Carbon::now()->addMinutes(5);
        $data->otp_verified   = false;
        $data->is_verified    = "0";
        // $data->otp_verified         = "";
        // $data->is_verified          = "0";
        $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('123456789');
        $data->save();
    }
}

