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