简体   繁体   English

Laravel “目标 [Illuminate\\Contracts\\Bus\\Dispatcher] 不可实例化。”

[英]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这对我有用,错误不再出现在密码重置链接上

In Laravel v. 5.2 the command bus has been removed.在 Laravel v. 5.2 ,命令总线已被移除。 Because of this you need to install it mazually from here to make it work.因此,您需要从这里mazually 安装它以使其工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 目标接口不可实例化。 Laravel 4 - Target Interface is not instantiable. Laravel 4 Laravel 5.8 目标 [Illuminate\Contracts\Debug\ExceptionHandler] 不可实例化 - Laravel 5.8 Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable 目标 [Illuminate\\Contracts\\Debug\\ExceptionHandler] 不可实例化 - Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable 目标 [Illuminate\Contracts\Broadcasting\Factory] 不可实例化 - Target [Illuminate\Contracts\Broadcasting\Factory] is not instantiable 目标不可实例化。 Laravel 5 - 应用绑定服务提供者 - Target is not instantiable. Laravel 5 - App binding service provider Laravel 5.1:Auth::logout() 不起作用并且目标 [Illuminate\\Contracts\\Auth\\Registrar] 不是可实例化的错误 - Laravel 5.1: Auth::logout() is not working and Target [Illuminate\Contracts\Auth\Registrar] is not instantiable error 目标 [Laravel\Fortify\Contracts\RegisterViewResponse] 不可实例化 - target [Laravel\Fortify\Contracts\RegisterViewResponse] is not instantiable PHPUnit 给出错误:目标 [Illuminate\Contracts\View\Factory] 不可实例化 - PHPUnit gives error: Target [Illuminate\Contracts\View\Factory] is not instantiable “目标 [App\\Http\\Controllers\\Controller] 不可实例化。” - "Target [App\Http\Controllers\Controller] is not instantiable." Illuminate\\Contracts\\Filesystem\\Factory 不可实例化 - Illuminate\Contracts\Filesystem\Factory is not instantiable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM