feat: implement VM snapshot management, enhance client resource loading, and refactor deployment workflow for production
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Mail;
|
||||
use App\Models\Template;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Attachment;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
@@ -16,22 +17,17 @@ class CreateVirtualMachine extends Mailable
|
||||
protected $template = null;
|
||||
protected $data;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($template = 0, $data = [])
|
||||
protected ?string $invoicePdf = null;
|
||||
protected ?string $invoicePdfFileName = null;
|
||||
|
||||
public function __construct($template = 0, $data = [], ?string $invoicePdf = null, ?string $invoicePdfFileName = null)
|
||||
{
|
||||
$this->data = $data;
|
||||
$this->template = Template::find($template);
|
||||
$this->invoicePdf = $invoicePdf;
|
||||
$this->invoicePdfFileName = $invoicePdfFileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*
|
||||
* @return Envelope
|
||||
*/
|
||||
public function envelope()
|
||||
{
|
||||
return new Envelope(
|
||||
@@ -39,11 +35,6 @@ class CreateVirtualMachine extends Mailable
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*
|
||||
* @return Content
|
||||
*/
|
||||
public function content()
|
||||
{
|
||||
return new Content(
|
||||
@@ -83,13 +74,15 @@ class CreateVirtualMachine extends Mailable
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function attachments()
|
||||
public function attachments(): array
|
||||
{
|
||||
if ($this->invoicePdf !== null && $this->invoicePdfFileName !== null) {
|
||||
return [
|
||||
Attachment::fromData(fn () => $this->invoicePdf, $this->invoicePdfFileName)
|
||||
->mime('application/pdf'),
|
||||
];
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user