public function index(Request $request)
    {
        $categories = $this->repository->allOrSearch($request->get('q'));

        $no = $categories->firstItem();

        return $this->view('categories.index', compact('categories', 'no'));
    }
public function index(Request $request)
    {
        $categories = $this->repository->allOrSearch($request->get('q'));

        $no = $categories->firstItem();

        return $this->view('categories.index', compact('categories', 'no'));
    }
public function index ( Request $ request ) { $ categories = $ this -> repository -> allOrSearch ( $ request -> get ( 'q' ) ) ; $ no = $ categories -> firstItem ( ) ; return $ this -> view ( 'categories.index' , compact ( 'categories' , 'no' ) ) ; }
Display a listing of categories.

@return Response
Display a listing of categories .