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