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