25 lines
620 B
PHP
25 lines
620 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Product;
|
|
use App\Models\ProductVariant;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<ProductVariant>
|
|
*/
|
|
class ProductVariantFactory extends Factory
|
|
{
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'product_id' => Product::factory(),
|
|
'name' => fake()->randomElement(['S', 'M', 'L', 'XL', 'All Size']),
|
|
'stock' => fake()->numberBetween(0, 100),
|
|
'retail_stock' => fake()->numberBetween(0, 50),
|
|
'reject_stock' => fake()->numberBetween(0, 20),
|
|
];
|
|
}
|
|
}
|