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