desired_location = DesiredLocation::make($data->desired_location)->label(); $this->data = clone $data; } /** * Get the message envelope. * * @return \Illuminate\Mail\Mailables\Envelope */ public function envelope(): \Illuminate\Mail\Mailables\Envelope { return new Envelope( subject: sprintf('%s - %s', __('Candidature spontanée'), config('app.name')), ); } /** * Get the message content definition. * * @return \Illuminate\Mail\Mailables\Content */ public function content(): \Illuminate\Mail\Mailables\Content { return new Content( markdown: 'emails.send-joinus-form', with: ['data' => $this->data], ); } /** * Get the attachments for the message. * * @return array */ public function attachments(): array { $attachments = []; if (isset($this->data->file)) { $attachments[] = Attachment::fromPath($this->data->file->getRealPath()) ->as($this->data->file->getClientOriginalName()) ->withMime($this->data->file->getClientMimeType()); } return $attachments; } } /** * @property string $last_name * @property string $first_name * @property string $email * @property string $phone * @property \App\Enums\DesiredLocation $desired_location * @property string $message * @property \Illuminate\Http\UploadedFile $file * @phpcs:disable PSR1.Classes.ClassDeclaration.MultipleClasses */ class Joinus extends \stdClass { }