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