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.
21 lines
384 B
PHTML
21 lines
384 B
PHTML
1 month ago
|
<?php
|
||
|
|
||
|
namespace Database\Seeders;
|
||
|
|
||
|
use App\Models\Customer;
|
||
|
use App\Models\Order;
|
||
|
use Illuminate\Database\Seeder;
|
||
|
|
||
|
class OrderSeeder extends Seeder
|
||
|
{
|
||
|
/**
|
||
|
* Run the database seeds.
|
||
|
*/
|
||
|
public function run(): void
|
||
|
{
|
||
|
foreach (Customer::all() as $customer) {
|
||
|
Order::factory(rand(2, 10), ['customer_id' => $customer])->create();
|
||
|
}
|
||
|
}
|
||
|
}
|