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