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