finish implementing mails

This commit is contained in:
Ludovic CANDELLIER
2023-04-17 00:27:03 +02:00
parent 24e518fffe
commit 313525a25b
8 changed files with 274 additions and 49 deletions

View File

@@ -8,6 +8,20 @@ use App\Models\Shop\Invoice;
class Invoices
{
public static function getInvoiceHtml($id)
{
$invoice = self::get($id, ['order.customer', 'order.address', 'order.detail']);
$order = $invoice->order;
$customer = $order->customer;
unset($invoice->order, $order->customer);
$data = [
'invoice' => $invoice->toArray(),
'order' => $order->toArray(),
'customer' => $customer->toArray(),
];
return view('Shop.Invoices.mail', $data)->render();
}
public static function getByUUID($uuid)
{
return Invoice::byUUID($uuid)->first();