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

@@ -37,6 +37,8 @@ class ComponentController extends AbstractApiController
$components = Component::enabled();
}
$components->search(Binput::except(['sort', 'order', 'per_page']));
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';

View File

@@ -31,6 +31,8 @@ class ComponentGroupController extends AbstractApiController
{
$groups = ComponentGroup::whereRaw('1=1');
$groups->search(Binput::except(['sort', 'order', 'per_page']));
if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';

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';