modules = $this->modules(config('ebuy.cart.modules'), 'cart', guard_url('cart')); $this->repository = $cart; } /** * Show cart's list. * * @return response */ protected function index(PublicRequest $request) { $search = $request->search; $pageLimit = $request->input('pageLimit', config('database.pagination.limit')); $data = $this->repository ->pushFilter(RequestFilter::class) ->pushFilter(CartPublicFilter::class) ->setPresenter(CartListPresenter::class) ->select('carts.*') ->paginate($pageLimit) ->withQueryString() ->toArray(); extract($data); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle(trans('cart::cart.names')) ->view('cart::public.cart.index') ->data(compact('data', 'meta', 'categories', 'tags', 'recent')) ->output(); } /** * Show cart. * * @param string $slug * * @return response */ protected function show(PublicRequest $request, $slug) { $data = $this->repository ->findBySlug($slug) ->toArray(); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle($data['title'] . trans('cart::cart.name')) ->view('cart::public.cart.show') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } }