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