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