<?php

namespace Database\Seeders;

use App\Models\PtwMstSoapPolicies;
use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class PtwMstSoapPoliciesSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        //lets truncate the existing records
       PtwMstSoapPolicies::truncate();

       $vvsFaker = \Faker\Factory::create();
       $userIds = User::pluck('ID')->all();

       for ($i = 0; $i < 10; $i++) {
        PtwMstSoapPolicies::create([
               "NAME" => $vvsFaker->word,
               "REFRENCE_NO" => $vvsFaker->word,
               "CREATED_BY" => $userIds[array_rand($userIds)],
           ]);
       }
    }
}
