mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 21:49:01 +01:00
Closes #1. Incidents output per-date
This commit is contained in:
parent
fab38a766d
commit
f86b4000c8
@ -17,7 +17,7 @@ class CreateIncidentsTable extends Migration {
|
||||
$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();
|
||||
|
@ -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>
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user