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