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