<?php

namespace Database\Seeders;

use App\Models\User;
use App\Models\User_details;
use App\Models\UserAccounting;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {

        $data = [
            [
                'name' => 'system',
                'email' => 'rokibulhasan.356@gmail.com',
                'password' => bcrypt('YetFix@admin22'),
            ],
            [
                'name' => 'Support',
                'email' => 'support@yetfix.com',
                'password' => bcrypt('support@2041'),
            ]
            ];

            foreach($data as $d){
               if(User::where('email',$d['email'])->count() < 1){
                $user = User::create($d);
                User_details::create([
                    'user_id' => $user->id,
                    'user_status' => 'active'
                ]);
               }
            }






    }
}
