29 lines
1,009 B
PHP
29 lines
1,009 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Product;
|
|
use App\Models\ProductWoodOrigin;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<ProductWoodOrigin>
|
|
*/
|
|
class ProductWoodOriginFactory extends Factory
|
|
{
|
|
protected $model = ProductWoodOrigin::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'product_id' => Product::factory(),
|
|
'wood_species' => fake()->randomElement(['Quercus robur', 'Fagus sylvatica', 'Pinus sylvestris', 'Picea abies']),
|
|
'origin_country' => fake()->randomElement(['DE', 'AT', 'PL', 'CZ', 'FR']),
|
|
'origin_region' => fake()->optional()->city(),
|
|
'harvest_year' => fake()->optional()->numberBetween(2020, 2026),
|
|
'forest_operator' => fake()->optional()->company(),
|
|
'sustainability_certificate' => fake()->optional()->randomElement(['FSC', 'PEFC', 'FSC/PEFC']),
|
|
'eudr_reference_id' => fake()->optional()->uuid(),
|
|
];
|
|
}
|
|
}
|