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