New setting to configure amount of days to show. Closes #231

This commit is contained in:
James Brooks
2015-01-02 08:23:29 +00:00
parent 42a1e50c12
commit b51529acdc
3 changed files with 12 additions and 1 deletions

View File

@@ -23,7 +23,9 @@ class HomeController extends Controller
$allIncidents = [];
foreach (range(0, 7) as $i) {
$incidentDays = Setting::get('app_incident_days') ?: 7;
foreach (range(0, $incidentDays) as $i) {
$date = Carbon::now()->subDays($i);
$incidents = Incident::whereBetween('created_at', [
$date->format('Y-m-d').' 00:00:00',