<?php

use Illuminate\Database\Seeder;
use App\Models\Vehicles;
use App\Models\CarShowCategory;
use App\Models\Bidders;

class VehiclesTableSeeder extends Seeder
{
    public function run()
    {
        $categories = CarShowCategory::all();
        $bidders = Bidders::all();

        factory(Vehicles::class, 40)->create([
            'type' => function () use ($categories) {
                return $categories->random()->id;
            },
            'owner' => function () use ($bidders) {
                return $bidders->random()->bidder_assigned_number;
            },
        ]);
    }
}
