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