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