repository = $task; parent::__construct(); } /** * Show task's list. * * @param string $slug * * @return response */ protected function index() { $tasks = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->setMetaTitle(trans('task::task.names')) ->view('task::public.task.index') ->data(compact('tasks')) ->output(); } /** * 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->response->setMetaTitle($task->name . trans('task::task.name')) ->view('task::public.task.show') ->data(compact('task')) ->output(); } }