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