*/ class DepartureTimeSlotFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { $time = Carbon::createFromTime(fake()->numberBetween(0, 23), fake()->randomElement([0, 15, 30, 45])); return [ 'label' => $time->format('h:i A'), 'time' => $time->format('H:i'), 'is_active' => true, ]; } }