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