repository = $worklog; parent::__construct(); } /** * Show worklog's list. * * @param string $slug * * @return response */ protected function index() { $worklogs = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->setMetaTitle(trans('pm::worklog.names')) ->view('pm::public.worklog.index') ->data(compact('worklogs')) ->output(); } /** * Show worklog. * * @param string $slug * * @return response */ protected function show($slug) { $worklog = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->setMetaTitle($worklog->name . trans('pm::worklog.name')) ->view('pm::public.worklog.show') ->data(compact('worklog')) ->output(); } }