Skip to content

Commit

Permalink
Closes #1. Incidents output per-date
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed Nov 16, 2014
1 parent fab38a7 commit f86b400
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function up()
$table->increments('id');
$table->tinyInteger('component')->default(1);
$table->string('name');
$table->tinyInteger('status', 1);
$table->tinyInteger('status', 1)->default(1);
$table->longText('message');
$table->timestamps();
$table->softDeletes();
Expand Down
3 changes: 2 additions & 1 deletion app/views/incident.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
$incidentDate = Carbon::now()->subDays($i);
$incidents = Incident::where('created_at', $incidentDate)->get()
$incidents = Incident::whereRaw('DATE(created_at) = "' . $incidentDate->format('Y-m-d') . '"')->get();
?>
<li>
<h1>{{ $incidentDate->format('jS M, Y') }}</h1>
Expand All @@ -11,6 +11,7 @@
@foreach($incidents as $incident)
<li>
<h2>{{ $incident->name }}</h2>
<h3><time>{{ $incident->created_at->format('H:i:s A') }}</time></h3>
<p>{{ $incident->message }}</p>
</li>
@endforeach
Expand Down

0 comments on commit f86b400

Please sign in to comment.