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