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