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