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