diff --git a/app/Http/Controllers/Reports/MonthlyReportController.php b/app/Http/Controllers/Reports/MonthlyReportController.php index 28c2831c..177a2feb 100644 --- a/app/Http/Controllers/Reports/MonthlyReportController.php +++ b/app/Http/Controllers/Reports/MonthlyReportController.php @@ -44,7 +44,7 @@ class MonthlyReportController return $date->isWeekday(); - }, $to->endOfMonth()); + }, $request->route('to') ? Carbon::parse($request->route('to'))->endOfMonth() : Carbon::now()->endOfMonth()); return (new ApiResponseObject('fetch monthly report Successful', '',