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.
22 lines
434 B
PHP
22 lines
434 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\ProductService;
|
|
use App\Models\ServiceFile;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class ServiceFileSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
foreach (ProductService::all() as $product) {
|
|
$file = ServiceFile::factory()->create();
|
|
$file->productServices()->save($product);
|
|
}
|
|
}
|
|
}
|