diff --git a/app/Http/Controllers/Backend/Transport/ManualTripCreator.php b/app/Http/Controllers/Backend/Transport/ManualTripCreator.php index c3db9895a..ef1fce488 100644 --- a/app/Http/Controllers/Backend/Transport/ManualTripCreator.php +++ b/app/Http/Controllers/Backend/Transport/ManualTripCreator.php @@ -122,8 +122,8 @@ public function addStopover( if ($plannedDeparture === null && $plannedArrival === null) { throw new InvalidArgumentException('Either arrival or departure must be set'); } - if ($plannedDeparture !== null && $plannedArrival !== null && $plannedDeparture->isAfter($plannedArrival)) { - throw new InvalidArgumentException('Departure must be before arrival'); + if ($plannedDeparture !== null && $plannedArrival !== null && $plannedDeparture->isBefore($plannedArrival)) { + throw new InvalidArgumentException('Departure must be after arrival'); } $this->stopovers[] = [