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