Get all incidents, get single incident, transformer for incidents

This commit is contained in:
manavo
2014-11-25 10:30:42 +00:00
parent a1844741bd
commit 683d3f2093
6 changed files with 47 additions and 4 deletions

View File

@@ -19,4 +19,16 @@
return $component->incidents;
}
public function getIncidents() {
return Incident::all();
}
public function getIncident($id) {
if ($incident = Incident::find($id)) {
return $incident;
} else {
App::abort(404, 'Incident not found');
}
}
}