repository = $events; parent::__construct(); } /** * Show events'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('event::events.names')) ->view('event::public.events.index') ->data(compact('events')) ->output(); } /** * Show events. * * @param string $slug * * @return response */ protected function show($slug) { $events = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->setMetaTitle($events->name . trans('event::events.name')) ->view('event::public.events.show') ->data(compact('events')) ->output(); } }