diff --git a/app/Models/Stopover.php b/app/Models/Stopover.php index be8261564..6801b717f 100644 --- a/app/Models/Stopover.php +++ b/app/Models/Stopover.php @@ -15,10 +15,12 @@ * @property int $train_station_id * @property UTCDateTime $arrival_planned * @property UTCDateTime $arrival_real + * @property UTCDateTime $arrival * @property string $arrival_platform_planned * @property string $arrival_platform_real * @property UTCDateTime $departure_planned * @property UTCDateTime $departure_real + * @property UTCDateTime $departure * @property string $departure_platform_planned * @property string $departure_platform_real * @property bool $isArrivalDelayed diff --git a/app/Observers/CheckinObserver.php b/app/Observers/CheckinObserver.php index 3d5c539c3..6b61114f0 100644 --- a/app/Observers/CheckinObserver.php +++ b/app/Observers/CheckinObserver.php @@ -7,11 +7,10 @@ class CheckinObserver { - public function updated(Checkin $checkin): void { if ($checkin->isDirty(['origin', 'destination', 'departure', 'arrival', 'manual_departure', 'manual_arrival'])) { //if origin, destination, departure or arrival is changed, update duration - TrainCheckinController::calculateCheckinDuration($checkin); + TrainCheckinController::calculateCheckinDuration($checkin->fresh()); } } }