Refactor how we get incidents

This commit is contained in:
Graham Campbell
2015-01-01 21:58:27 +00:00
parent 21d9b70bbc
commit 02f0da4c03
3 changed files with 21 additions and 14 deletions
+3 -3
View File
@@ -22,11 +22,11 @@
@include('partials.components')
{{-- @if(Setting::get('display_graphs'))
@include('partials.graphs')
@include('partials.graphs')
@endif --}}
<h1>{{ trans('cachet.past_incidents') }}</h1>
@foreach(range(0, 7) as $i => $v)
@include('partials.incident', array('i', $i))
@foreach($allIncidents as $incidents)
@include('partials.incidents', $incidents)
@endforeach
@stop
@@ -1,11 +1,4 @@
<?php
$incidentDate = Carbon\Carbon::now()->subDays($i);
$incidents = Incident::whereBetween('created_at', [
$incidentDate->format('Y-m-d') . ' 00:00:00',
$incidentDate->format('Y-m-d') . ' 23:59:59',
])->orderBy('created_at', 'desc')->get();
?>
<h4>{{ $incidentDate->format('jS F Y') }}</h4>
<h4>{{ $date }}</h4>
<div class='timeline'>
<div class='content-wrapper'>
@forelse($incidents as $incidentID => $incident)