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