relocating

This commit is contained in:
twotalesanimation
2025-12-30 20:59:58 +02:00
parent a898c35a39
commit e8e9b1f03c
117 changed files with 2104 additions and 8554 deletions
+63
View File
@@ -0,0 +1,63 @@
<?php
namespace App\Mail;
use App\Models\Order;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Mail\Mailables\Attachment;
use Illuminate\Queue\SerializesModels;
class InvoiceEmail extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*/
public function __construct(
public Order $order,
public string $invoicePath
) {}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: 'Invoice #' . $this->order->order_number . ' from Additional Design',
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
view: 'emails.invoice',
with: [
'order' => $this->order,
'invoiceNumber' => $this->order->order_number,
],
);
}
/**
* Get the attachments for the message.
*
* @return array<int, Attachment>
*/
public function attachments(): array
{
return [
Attachment::fromPath($this->invoicePath)
->as('Invoice-' . $this->order->order_number . '.pdf')
->withMime('application/pdf'),
];
}
}