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