Basic output of incidents

This commit is contained in:
James Brooks 2014-11-16 23:17:34 +00:00
parent ba6892e858
commit fab38a766d
6 changed files with 44 additions and 23 deletions

View File

@ -155,6 +155,7 @@ return array(
'Auth' => 'Illuminate\Support\Facades\Auth',
'Blade' => 'Illuminate\Support\Facades\Blade',
'Cache' => 'Illuminate\Support\Facades\Cache',
'Carbon' => 'Carbon\Carbon',
'ClassLoader' => 'Illuminate\Support\ClassLoader',
'Config' => 'Illuminate\Support\Facades\Config',
'Controller' => 'Illuminate\Routing\Controller',

View File

@ -1,23 +1,7 @@
<?php
class HomeController extends BaseController {
/*
|--------------------------------------------------------------------------
| Default Home Controller
|--------------------------------------------------------------------------
|
| You may wish to use controllers instead of, or in addition to, Closure
| based routes. That's great! Here is an example controller method to
| get you started. To route to this controller, just add the route:
|
| Route::get('/', 'HomeController@showWelcome');
|
*/
public function showWelcome()
{
return View::make('hello');
class HomeController extends BaseController {
public function showIndex() {
return View::make('index');
}
}
}

View File

@ -1,5 +1,3 @@
<?php
Route::get('/', function() {
return View::make('hello');
});
Route::get('/', 'HomeController@showIndex');

View File

@ -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>

View File

@ -0,0 +1,9 @@
@extends('layout.master')
@section('content')
<ul>
@for ($i=0; $i <= 7; $i++)
@include('incident', array('i', $i))
@endfor
</ul>
@stop

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Cachet</title>
</head>
<body>
@section('content')
@show
</body>
</html>