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->title(trans('$event_package::$event.names')) ->view('$event_package::public.event.index') ->data(compact('$events')) ->output(); } /** * Show event's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $events = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$event_package::$event.names')) ->view('$event_package::public.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->title($$event->name . trans('$event_package::$event.name')) ->view('$event_package::public.event.show') ->data(compact('$event')) ->output(); } }