fanatic/database/seeders/JoinedSeeder.php

25 lines
453 B
PHP
Raw Normal View History

2022-04-23 16:52:47 -07:00
<?php
namespace Database\Seeders;
use App\Models\Category;
use App\Models\Joined;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class JoinedSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Joined::factory()
->count(50)
2022-04-25 19:50:01 -07:00
->hasAttached(Category::inRandomOrder()->limit(rand(0,10)))
2022-04-23 16:52:47 -07:00
->create();
}
}