Include changes required within View Composers

This commit is contained in:
James Brooks
2014-11-17 00:10:02 +00:00
parent 57c64f6fbe
commit 7ef95ca3aa
3 changed files with 32 additions and 24 deletions
+5 -5
View File
@@ -1,15 +1,15 @@
<?php
$incidentDate = Carbon::now()->subDays($i);
$incidents = Incident::whereRaw('DATE(created_at) = "' . $incidentDate->format('Y-m-d') . '"')->get();
$incidents = Incident::whereRaw('DATE(created_at) = "' . $incidentDate->format('Y-m-d') . '"')->orderBy('created_at', 'desc')->get();
?>
<li>
<li class='list-group-item'>
<h1>{{ $incidentDate->format('jS M, Y') }}</h1>
<ul>
<ul class='list-group'>
@if($incidents->count() === 0)
<li>No incidents reported.</li>
<li class='list-group-item'>No incidents reported.</li>
@else
@foreach($incidents as $incident)
<li>
<li class='list-group-item'>
<h2>{{ $incident->name }}, <small>{{ $incident->humanStatus }}</small></h2>
<h3><time>{{ $incident->created_at->format('H:i:s A') }}</time></h3>
<p>{{ $incident->message }}</p>