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