/**
  * Show the application dashboard to the user.
  *
  * @param Request $request
  * @return Response
  */
 public function index(Request $request)
 {
     $criteria = $request->get('criteria');
     $query = $request->get('query');
     switch ($criteria) {
         case 'reference':
             $cabinets = Cabinet::reference($query)->paginate();
             break;
         case 'street':
             $cabinets = Cabinet::street($query)->paginate();
             break;
         case 'croos':
             $cabinets = Cabinet::croos($query)->paginate();
             break;
         case '':
             $cabinets = Cabinet::reference($query)->paginate();
             break;
     }
     return view('index')->with('cabinets', $cabinets)->with('title', trans('titles.home'));
 }
 /**
  * Display a listing of the resource.
  * @param Request $request
  * @return $this
  */
 public function index(Request $request)
 {
     $cabinets = Cabinet::reference($request->get('reference'))->orderBy('created_at', 'DESC')->paginate();
     return view('admin.cabinets.index')->with('cabinets', $cabinets)->with('title', trans('titles.manager_cabinets'));
 }