From bf0c65c9c550e7cab248f2262246151e12bff07f Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 27 May 2026 09:07:18 +0530 Subject: [PATCH] Modified logic in vehicle controller for calculation of duration time --- app/Http/Controllers/VehicleController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/VehicleController.php b/app/Http/Controllers/VehicleController.php index 2f310bb..804f67d 100644 --- a/app/Http/Controllers/VehicleController.php +++ b/app/Http/Controllers/VehicleController.php @@ -183,8 +183,10 @@ class VehicleController extends Controller !empty($entryTime) && !empty($exitTime) ) { + $entry = Carbon::parse($entryTime); // 2026-05-22 16:13:35 + $exit = Carbon::parse($exitTime); // 2026-05-25 14:17:29 - $totalSeconds = $entryTime->diffInSeconds($exitTime); + $totalSeconds = $entry->diffInSeconds($exit); $hours = floor($totalSeconds / 3600); $minutes = floor(($totalSeconds % 3600) / 60);