From e2b73e7bd475e1cf5fef4db1c7cef0b555c39835 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Fri, 20 Oct 2017 17:22:01 +0100 Subject: [PATCH] Fix undefined variable --- app/Http/Controllers/StatusPageController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/StatusPageController.php b/app/Http/Controllers/StatusPageController.php index a05df597..07f1194d 100644 --- a/app/Http/Controllers/StatusPageController.php +++ b/app/Http/Controllers/StatusPageController.php @@ -64,10 +64,10 @@ class StatusPageController extends AbstractApiController } $appIncidentDays = (int) Config::get('setting.app_incident_days', 1); - $incidentDays = array_pad([], $daysToShow, null); + $incidentDays = array_pad([], $appIncidentDays, null); $allIncidents = Incident::where('visible', '>=', (int) !Auth::check())->whereBetween('occurred_at', [ - $startDate->copy()->subDays($daysToShow)->format('Y-m-d').' 00:00:00', + $startDate->copy()->subDays($appIncidentDays)->format('Y-m-d').' 00:00:00', $startDate->format('Y-m-d').' 23:59:59', ])->orderBy('occurred_at', 'desc')->get()->groupBy(function (Incident $incident) { return app(DateFactory::class)->make($incident->occurred_at)->toDateString(); @@ -90,12 +90,12 @@ class StatusPageController extends AbstractApiController }, SORT_REGULAR, true); return View::make('index') - ->withDaysToShow($daysToShow) + ->withDaysToShow($appIncidentDays) ->withAllIncidents($allIncidents) ->withCanPageForward((bool) $today->gt($startDate)) ->withCanPageBackward(Incident::where('occurred_at', '<', $startDate->format('Y-m-d'))->count() > 0) - ->withPreviousDate($startDate->copy()->subDays($daysToShow)->toDateString()) - ->withNextDate($startDate->copy()->addDays($daysToShow)->toDateString()); + ->withPreviousDate($startDate->copy()->subDays($appIncidentDays)->toDateString()) + ->withNextDate($startDate->copy()->addDays($appIncidentDays)->toDateString()); } /**