modules = $this->modules(config('b2buy.contact.modules'), 'b2buy', guard_url('b2buy')); $this->repository = $b2buy; } /** * Show b2buy'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(B2buyPublicFilter::class) ->setPresenter(B2buyListPresenter::class) ->select('b2buys.*') ->paginate($pageLimit) ->withQueryString() ->toArray(); extract($data); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle(trans('contact::b2buy.names')) ->view('contact::public.b2buy.index') ->data(compact('data', 'meta', 'categories', 'tags', 'recent')) ->output(); } /** * Show b2buy. * * @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('contact::b2buy.name')) ->view('contact::public.b2buy.show') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } }