Trait 'Illuminate\Foundation\Bus\DispatchesJobs' not found

- 1 answer


I am using to export and import the database to excel file. Everything was running like a charm, but after several days, I found that something wrong with this library. It does not sudden happen, indeed, I add more features in the application and finally found this error.

FatalErrorException in LaravelExcelReader.php line 29:
Trait 'Illuminate\Foundation\Bus\DispatchesJobs' not found

It seems something wrong with the library that used from Maatwebsite library. After several hours trying to figure out what's the problem, I couldn't find any clue where the DispatchesJobs comes from.

Maybe, anybody have a clue for a problem that I face? I really appreciated for that. Thanks!




That was true @jedrzej.kurylo.. the Maatwebsite plugin version is the root cause of the problem. A problem that happen on me is that I declare in composer.json this.

"maatwebsite/excel": "~2.0",

if I remember well, I do run composer self-update before and automatically composer install the laters version(even though I already declare my composer.json in version 2.0).

To solve this problem, I add more detail in my composer.json

"maatwebsite/excel": "~2.0.0",

and then run composer update. The result is that the composer downgrade the library version.

Updating dependencies (including require-dev)
 - Removing maatwebsite/excel (v2.1.0)
 - Installing maatwebsite/excel (v2.0.10)
   Loading from cache

After that, everything should be alright!