TheDBeetle
TheDBeetle

Reputation: 79

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.. I'm trying to use a custom script and include the default Laravel classes

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. Any ideas?

Upvotes: 4

Views: 4028

Answers (2)

Jaber Al Nahian
Jaber Al Nahian

Reputation: 1061

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.

This worked for me and the error no more appeared on Password reset link click

Upvotes: 1

thmspl
thmspl

Reputation: 2495

In Laravel v.5.2 the command bus has been removed. Because of this you need to install it mazually from here to make it work.

Upvotes: 0

Related Questions