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