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