repository = $calendars; parent::__construct(); } /** * Show calendars's list. * * @param string $slug * * @return response */ protected function index() { $calendars = $this->repository->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->theme->of('calendar::public.calendars.index', compact('calendars'))->render(); } /** * Show calendars. * * @param string $slug * * @return response */ protected function show($slug) { $calendars = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->theme->of('calendar::public.calendars.show', compact('calendars'))->render(); } }