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