user()->client->id) ->whereIn('status_id', [RecurringInvoice::STATUS_PENDING, RecurringInvoice::STATUS_ACTIVE, RecurringInvoice::STATUS_COMPLETED]) ->orderBy('status_id', 'asc') ->with('client') ->paginate(10); return $this->render('recurring_invoices.index', [ 'invoices' => $invoices, ]); } /** * Display the recurring invoice. * * @param ShowRecurringInvoiceRequest $request * @param RecurringInvoice $recurring_invoice * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function show(ShowRecurringInvoiceRequest $request, RecurringInvoice $recurring_invoice) { return $this->render('recurring_invoices.show', [ 'invoice' => $recurring_invoice->load('invoices'), ]); } public function requestCancellation(Request $request, RecurringInvoice $recurring_invoice) { //todo double check the user is able to request a cancellation //can add locale specific by chaining ->locale(); $recurring_invoice->user->notify(new ClientContactRequestCancellation($recurring_invoice, auth()->user())); return $this->render('recurring_invoices.cancellation.index', [ 'invoice' => $recurring_invoice, ]); } }