I'm trying to send an email in Laravel, but I'm encountering an issue when using the to keyword in the email. The email doesn't send as expected, and I suspect it's because to is a reserved keyword in PHP. How can I properly send an email using the to keyword in Laravel without it causing any issue
class ProgressReportMailTest extends Mailable
{
use Queueable, SerializesModels;
public $to;
public $emailBody;
public function __construct($data)
{
$this->to = $data['to'];
$this->emailBody = $data['emailbody'] ?? null;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->view('your view');
}
}
tois a reserved keyword in PHP?