Search on status label type

This commit is contained in:
snipe 2017-02-08 03:37:44 -08:00
parent 4cf01e4f48
commit 72ec362f72

View file

@ -49,7 +49,7 @@ class AssetsController extends Controller
* @since [v4.0] * @since [v4.0]
* @return JsonResponse * @return JsonResponse
*/ */
public function index(Request $request, $status = null) public function index(Request $request)
{ {
$this->authorize('index', Asset::class); $this->authorize('index', Asset::class);
@ -116,7 +116,7 @@ class AssetsController extends Controller
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'assets.created_at'; $sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'assets.created_at';
$assets->orderBy($sort, $order); $assets->orderBy($sort, $order);
switch ($status) { switch ($request->input('status')) {
case 'Deleted': case 'Deleted':
$assets->withTrashed()->Deleted(); $assets->withTrashed()->Deleted();
break; break;