Skip to content

Commit

Permalink
feat: Updated app/Http/Controllers/InvoiceControll
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Mar 11, 2024
1 parent ef731cb commit f692b5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Http/Controllers/InvoiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public function downloadInvoiceAsPDF($id)
public function sendInvoiceToCustomer($id)
{
$invoice = Invoice::with('customer')->findOrFail($id);
Mail::to($invoice->customer->email)->send(new InvoiceMail($invoice));
$pdf = \Livewire\Livewire::mount('invoice-pdf', ['invoiceId' => $id])->httpResponse->getContent();
Mail::to($invoice->customer->email)->send(new InvoiceMail($invoice, $pdf));
return response()->json(['message' => 'Invoice sent to customer successfully.']);
}
}

0 comments on commit f692b5a

Please sign in to comment.