Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何解决这个问题。。。调用未定义的方法Illumb\Mail\PendingMail::sent()_Php_Laravel - Fatal编程技术网

Php 如何解决这个问题。。。调用未定义的方法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

我试图从我的UserController发送邮件,但我遇到了一个异常

错误按摩 Symfony\Component\Debug\Exception\FatalThroTableError 调用未定义的方法Illumb\Mail\PendingMail::sent()

我的代码 用户控制器:

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不知道方法,也不知道最有可能的是类。您的依赖项注入可能有问题。如果您发布完整的邮件和用户控制器类,可能会有所帮助