Php 如何解决这个问题。。。调用未定义的方法Illumb\Mail\PendingMail::sent()
我试图从我的UserController发送邮件,但我遇到了一个异常 错误按摩 Symfony\Component\Debug\Exception\FatalThroTableError 调用未定义的方法Illumb\Mail\PendingMail::sent() 我的代码 用户控制器:Php 如何解决这个问题。。。调用未定义的方法Illumb\Mail\PendingMail::sent(),php,laravel,Php,Laravel,我试图从我的UserController发送邮件,但我遇到了一个异常 错误按摩 Symfony\Component\Debug\Exception\FatalThroTableError 调用未定义的方法Illumb\Mail\PendingMail::sent() 我的代码 用户控制器: public function __construct(User $user) { $this->user = $user; } public function build() { r
public function __construct(User $user)
{
$this->user = $user;
}
public function build()
{
return $this->view('Email.verification')
->with([
'uname' => $this->user->uname,
'token' => $this->user->email_verification_token,
])
->bcc('pmsaidur@gmail.com')
->subject('Test');
}
Mail::to($user->email)->sent(新变种邮件($user));
MailController:
public function __construct(User $user)
{
$this->user = $user;
}
public function build()
{
return $this->view('Email.verification')
->with([
'uname' => $this->user->uname,
'token' => $this->user->email_verification_token,
])
->bcc('pmsaidur@gmail.com')
->subject('Test');
}
您的代码中有一个输入错误。它应该是
send()
而不是send()
:
您应该始终添加使用的版本;-)不知何故,Symfony不知道方法,也不知道最有可能的是类。您的依赖项注入可能有问题。如果您发布完整的邮件和用户控制器类,可能会有所帮助