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