/** * Single category page * * @param $categorySlug * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function getCategory($categorySlug) { $category = $this->categoryRepo->getCategoryBySlug($categorySlug); if (!$category) { abort(404); } return view('front.category'); }
/** * Get single category * * @param $categorySlug * @return \Illuminate\Http\JsonResponse */ public function getCategory($categorySlug) { $category = $this->categoryRepo->getCategoryBySlug($categorySlug); return response()->json(['success' => $category]); }