Add seeders and factories for all models

This commit is contained in:
2026-04-29 20:38:05 -04:00
parent 00ff08e3a6
commit a8fd03f256
14 changed files with 351 additions and 9 deletions
@@ -0,0 +1,25 @@
<?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,
]);
}
}
}
}