<?php

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

class CarShowWinnerTableSeeder extends Seeder
{
    public function run()
    {
        $categories = CarShowCategory::all();
        $vehicles = Vehicles::all();

        foreach ($categories as $category) {
            for ($i = 1; $i <= 3; $i++) {
                factory(CarShowWinner::class)->create([
                    'category' => $category->id,
                    'vehicle' => $vehicles->random()->id,
                    'place' => $i,
                ]);
            }
        }
    }
}
