/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($slug) { $productSubCategory = ProductSubCategory::whereSlug($slug)->first(); return response()->json(['productSubCategory' => $productSubCategory]); }