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