You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
475 B
PHP
25 lines
475 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Order;
|
|
use App\Models\Quote;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class QuoteSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
foreach (Order::all() as $order) {
|
|
if (rand(0, 3) >= 1) {
|
|
Quote::factory([
|
|
'created_at' => $order->order_date,
|
|
])->for($order)->create();
|
|
}
|
|
}
|
|
}
|
|
}
|