markdown-mail.stub
TLDR
This file is a stub for a Markdown mail Mailable class in the Illuminate\Foundation\Console\stubs directory. It contains a class that extends the Illuminate\Mail\Mailable class and defines methods for constructing the message instance, getting the message envelope, getting the message content definition, and getting the attachments for the message.
Methods
__construct
This method is the constructor for the Mailable class and does not have any code inside it.
envelope
This method returns a new instance of the Envelope class, which represents the message envelope. The method takes no arguments.
content
This method returns a new instance of the Content class, which represents the message content definition. The method takes no arguments.
attachments
This method returns an empty array and is used to define attachments for the message. It has a return type of array<int, \Illuminate\Mail\Mailables\Attachment>.
Classes
There are no additional classes in this file.
<?php
namespace {{ namespace }};
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\Queue\SerializesModels;
class {{ class }} extends Mailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*/
public function __construct()
{
//
}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: '{{ subject }}',
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
markdown: '{{ view }}',
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}