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