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