سلام من کانفیگها رو انجام دادم و روت رو هم مثل استاد نوشتم اما ارور زیر رو دارم موقع اجرای روت
Trying to access array offset on value of type null
MAIL_MAILER=smtp
MAIL_HOST=sandbox.smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=نام کاربری که خودش میده
MAIL_PASSWORD=پسوردی که خودش میده
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
روت
Route::get(
'/email',
function () {
Mail::to('70.mehrjoo@gmail.com')->send(new VerifyEmail);
}
);
و خود کلاس verifyemail
class VerifyEmail 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: 'Verify Email',
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
view: 'emails.verify-email',
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}