*/ 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(), 'status' => ProductStatus::ACTIVE, ]; } public function inactive(): static { return $this->state(fn (array $attributes) => [ 'status' => ProductStatus::INACTIVE, ]); } }