repository = $attributes; parent::__construct(); } /** * Show attributes'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('$customized::$attributes.names')) ->view('$customized::public.attributes.index') ->data(compact('$attributes')) ->output(); } /** * Show attributes'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('$customized::$attributes.names')) ->view('$customized::public.attributes.index') ->data(compact('$attributes')) ->output(); } /** * Show attributes. * * @param string $slug * * @return response */ protected function show($slug) { $attributes = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$attributes->name . trans('$customized::$attributes.name')) ->view('$customized::public.attributes.show') ->data(compact('$attributes')) ->output(); } }