user()->client->id) ->whereIn('status_id', [RecurringInvoice::STATUS_PENDING, RecurringInvoice::STATUS_ACTIVE, RecurringInvoice::STATUS_COMPLETED]) ->orderBy('status_id', 'asc') ->get(); if (request()->ajax()) { return DataTables::of($invoices)->addColumn('action', function ($invoice) { return ''.ctrans('texts.view').''; })->addColumn('frequency_id', function ($invoice) { return RecurringInvoice::frequencyForKey($invoice->frequency_id); }) ->editColumn('status_id', function ($invoice){ return RecurringInvoice::badgeForStatus($invoice->status); }) ->rawColumns(['action', 'status_id']) ->make(true); } $data['html'] = $builder; return view('portal.default.recurring_invoices.index', $data); } /** * Display the specified resource. * * @param \App\Models\Invoice $invoice The invoice * * @return \Illuminate\Http\Response */ public function show(ShowRecurringInvoiceRequest $request, RecurringInvoice $recurring_invoice) { $data = [ 'invoice' => $recurring_invoice->load('invoices'), ]; return view('portal.default.recurring_invoices.show', $data); } }