/**
  * Display a listing of the resource.
  *
  * @param Request $request
  * @return Response
  */
 public function index(Request $request)
 {
     $search = $request->all();
     $search['q'] = isset($search['q']) ? trim($search['q']) : '';
     $search['published'] = isset($search['published']) ? $search['published'] : '';
     $categories = $this->categoryRepository->getAll($search);
     return View('admin.categories.index')->with(['categories' => $categories, 'search' => $search['q'], 'selectedStatus' => $search['published']]);
 }