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