*/ class ProductFactory extends Factory { protected $model = Product::class; public function definition(): array { return [ 'year' => (int) date('Y'), 'article' => fake()->unique()->bothify('MAF-####'), 'name_tz' => fake()->sentence(3), 'type_tz' => fake()->randomElement(['Горка', 'Качели', 'Песочница', 'Карусель']), 'nomenclature_number' => fake()->numerify('######'), 'sizes' => fake()->numerify('####x####x####'), 'manufacturer' => fake()->company(), 'manufacturer_name' => fake()->company(), 'unit' => 'шт', 'type' => fake()->randomElement(['standard', 'custom']), 'product_price' => fake()->randomFloat(2, 10000, 500000), 'installation_price' => fake()->randomFloat(2, 5000, 50000), 'total_price' => fake()->randomFloat(2, 15000, 550000), 'service_life' => fake()->numberBetween(5, 15), 'note' => fake()->sentence(), ]; } }