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('medium::brand.names')) ->view('medium::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('medium::brand.name')) ->view('medium::public.brand.show') ->data(compact('brand')) ->output(); } }