[英]Laravel "Target [Illuminate\Contracts\Bus\Dispatcher] is not instantiable."
As the title itself says, I've got the following issue: Target [Illuminate\\Contracts\\Bus\\Dispatcher] is not instantiable.
正如标题本身所说,我遇到了以下问题: Target [Illuminate\\Contracts\\Bus\\Dispatcher] is not instantiable.
. . I'm trying to use a custom script and include the default Laravel classes我正在尝试使用自定义脚本并包含默认的 Laravel 类
require_once dirname(__DIR__) . '/vendor/autoload.php';
require_once dirname(__DIR__) . '/bootstrap/app.php';
use App\Mail\ChangeInStatusMail;
use App\Jobs\SendEmail;
After using SendEmail::dispatch() I get the previously mentioned error.使用 SendEmail::dispatch() 后,我收到了前面提到的错误。 Any ideas?有任何想法吗?
Since I have experience of updating from laravel 5.2 to 5.8 or so, I had to replace ' Collective\\Bus\\BusServiceProvider
', with ' Illuminate\\Bus\\BusServiceProvider
', in providers array in config/app.php.由于我有从 laravel 5.2 更新到 5.8 左右的经验,我不得不将 config/app.php 中的 providers 数组中的“ Collective\\Bus\\BusServiceProvider
”替换为“ Illuminate\\Bus\\BusServiceProvider
”。
This worked for me and the error no more appeared on Password reset link click这对我有用,错误不再出现在密码重置链接上
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.