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