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