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