*/ class ProductFactory extends Factory { public function definition(): array { $name = fake()->unique()->words(3, true); return [ 'name' => Str::limit($name, 200, ''), 'slug' => Str::slug($name), 'description' => fake()->optional()->paragraph(), 'is_active' => true, 'status' => ProductStatus::APPROVED, 'was_ever_approved' => true, ]; } public function inactive(): static { return $this->state(fn (array $attributes) => [ 'is_active' => false, ]); } }