*/ class CuttingFactory extends Factory { public function definition(): array { return [ 'status' => CuttingStatus::IN_PROGRESS->value, 'description' => fake()->optional()->sentence(3), 'created_by_id' => User::factory(), ]; } public function completed(): static { return $this->state(fn (array $attributes) => [ 'status' => CuttingStatus::COMPLETED->value, ]); } }