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