From aaaf2e7c00d8b32c0216c0225aee7fd3b2f2d707 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Sat, 24 Oct 2020 16:04:09 -0400 Subject: [PATCH] Make sure capacity is an integer --- app/Services/FareService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/FareService.php b/app/Services/FareService.php index 0436a56a..4189dcd6 100644 --- a/app/Services/FareService.php +++ b/app/Services/FareService.php @@ -87,9 +87,9 @@ class FareService extends Service if (filled($pivot->capacity)) { if (strpos($pivot->capacity, '%', -1) !== false) { - $fare->capacity = Math::addPercent($fare->capacity, $pivot->capacity); + $fare->capacity = floor(Math::addPercent($fare->capacity, $pivot->capacity)); } else { - $fare->capacity = $pivot->capacity; + $fare->capacity = floor($pivot->capacity); } }