Basic output of incidents
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
$incidentDate = Carbon::now()->subDays($i);
|
||||
$incidents = Incident::where('created_at', $incidentDate)->get()
|
||||
?>
|
||||
<li>
|
||||
<h1>{{ $incidentDate->format('jS M, Y') }}</h1>
|
||||
<ul>
|
||||
@if($incidents->count() === 0)
|
||||
<li>No incidents reported.</li>
|
||||
@else
|
||||
@foreach($incidents as $incident)
|
||||
<li>
|
||||
<h2>{{ $incident->name }}</h2>
|
||||
<p>{{ $incident->message }}</p>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
</li>
|
||||
@@ -0,0 +1,9 @@
|
||||
@extends('layout.master')
|
||||
|
||||
@section('content')
|
||||
<ul>
|
||||
@for ($i=0; $i <= 7; $i++)
|
||||
@include('incident', array('i', $i))
|
||||
@endfor
|
||||
</ul>
|
||||
@stop
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Cachet</title>
|
||||
</head>
|
||||
<body>
|
||||
@section('content')
|
||||
@show
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user