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