From b5866871749c314868ecaf37d79608bd4919eb17 Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Mon, 12 Dec 2022 18:25:11 -0600 Subject: [PATCH] Change checkin ID filtering --- app/Http/Controllers/TrackerController.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/TrackerController.php b/app/Http/Controllers/TrackerController.php index 6f9d223..57bd9da 100644 --- a/app/Http/Controllers/TrackerController.php +++ b/app/Http/Controllers/TrackerController.php @@ -47,20 +47,18 @@ class TrackerController extends Controller if ($fromCheckin) { $tripData->checkins = array_filter( $tripData->checkins, - function ($key) use ($fromCheckin) { - return $key >= $fromCheckin; - }, - ARRAY_FILTER_USE_KEY + function ($checkin) use ($fromCheckin) { + return $checkin->id >= $fromCheckin; + } ); } if ($toCheckin) { $tripData->checkins = array_filter( $tripData->checkins, - function ($key) use ($toCheckin) { - return $key <= $toCheckin; - }, - ARRAY_FILTER_USE_KEY + function ($checkin) use ($toCheckin) { + return $checkin->id <= $toCheckin; + } ); }