<?php


namespace App\Mail;


use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class ForgotMail extends Mailable
{
    use Queueable, SerializesModels;
    public $data;  // 传递给邮件视图的数据

    public function __construct($data)
    {
        $this->data = $data;
    }

    public function build()
    {
        return $this->view('emails.forgot')  // 设置邮件的视图
        ->subject('验证邮件')  // 设置邮件的主题
        ->with(['data' => $this->data]);  // 传递给视图的数据
    }
}
