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