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