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