Skip to content

Commit

Permalink
Fix undefined variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed Oct 20, 2017
1 parent b2f7ca6 commit e2b73e7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Http/Controllers/StatusPageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ public function showIndex()
}

$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();
Expand All @@ -90,12 +90,12 @@ public function showIndex()
}, 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());
}

/**
Expand Down

0 comments on commit e2b73e7

Please sign in to comment.