repository = $product_subcategory; parent::__construct(); } /** * Show product_subcategory's list. * * @param string $slug * * @return response */ protected function index() { $product_subcategories = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$product::$product_subcategory.names')) ->view('$product::public.product_subcategory.index') ->data(compact('$product_subcategories')) ->output(); } /** * Show product_subcategory's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $product_subcategories = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$product::$product_subcategory.names')) ->view('$product::public.product_subcategory.index') ->data(compact('$product_subcategories')) ->output(); } /** * Show product_subcategory. * * @param string $slug * * @return response */ protected function show($slug) { $product_subcategory = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$product_subcategory->name . trans('$product::$product_subcategory.name')) ->view('$product::public.product_subcategory.show') ->data(compact('$product_subcategory')) ->output(); } }