New setting to configure amount of days to show. Closes #231
This commit is contained in:
@@ -47,6 +47,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-xs-12'>
|
||||
<div class='form-group'>
|
||||
<label>How many days of incidents to show?</label>
|
||||
<input type='number' min='1' max='100' name='app_incident_days' class='form-control' value='{{ Setting::get("app_incident_days") ?: 7 }}' />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-xs-12'>
|
||||
<div class='form-group'>
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
|
||||
<hr />
|
||||
<div class='form-group'>
|
||||
<input type='hidden' name='settings[app_incident_days]' value='7' />
|
||||
<button type='submit' class='btn btn-success'>{{ trans("cachet.forms.setup.finish_setup") }}</button>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user