Implement very basic API searching. Closes #1348

This commit is contained in:
James Brooks
2016-03-01 15:05:41 +00:00
committed by James Brooks
parent 9379ab131c
commit 0b3483fb8a
7 changed files with 93 additions and 3 deletions

View File

@@ -34,6 +34,8 @@ class IncidentController extends AbstractApiController
$incidents = Incident::where('visible', '>=', $incidentVisibility);
$incidents->search(Binput::except(['sort', 'order', 'per_page']));
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';