Uploading content
This commit is contained in:
22
database/seeders/ProductSeeder.php
Normal file
22
database/seeders/ProductSeeder.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Product;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ProductSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$batchSize = 5000; // Ajusta este valor si es necesario
|
||||
$totalRecords = 300000;
|
||||
|
||||
for ($i = 0; $i < $totalRecords / $batchSize; $i++) {
|
||||
Product::factory($batchSize)->create();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user