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