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