repository = $invoice; parent::__construct(); } /** * Show invoice's list. * * @param string $slug * * @return response */ protected function index() { $invoices = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->setMetaTitle(trans('$invoice::invoice.names')) ->view('invoice::invoice.index') ->data(compact('invoices')) ->output(); } /** * Show invoice. * * @param string $slug * * @return response */ protected function show($slug) { $invoice = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->setMetaTitle($$invoice->name . trans('invoice::invoice.name')) ->view('invoice::invoice.show') ->data(compact('invoice')) ->output(); } }