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