backoffice first commit

This commit is contained in:
2026-07-17 11:34:15 +02:00
parent 761db06329
commit 1c40ef6601
159 changed files with 25830 additions and 7875 deletions
+52
View File
@@ -0,0 +1,52 @@
<?php
namespace App\Mail;
use App\Models\Preventivo;
use App\Support\PreventivoPdf;
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;
class PreventivoCliente extends Mailable
{
use Queueable, SerializesModels;
public function __construct(public Preventivo $preventivo)
{
}
public function envelope(): Envelope
{
return new Envelope(
subject: 'Il tuo preventivo Krèios n. '.$this->preventivo->numero,
);
}
public function content(): Content
{
return new Content(
markdown: 'emails.preventivo-cliente',
with: ['preventivo' => $this->preventivo],
);
}
/** @return array<int, Attachment> */
public function attachments(): array
{
$path = PreventivoPdf::pathAssoluto($this->preventivo);
if (! $path) {
return [];
}
return [
Attachment::fromPath($path)
->as('preventivo-'.$this->preventivo->numero.'.pdf')
->withMime('application/pdf'),
];
}
}