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

I am using http://www.maatwebsite.nl/laravel-excel/docs 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!

This trait was added in Laravel 5.1 - in older versions you're supposed to use Illuminate\Foundation\Bus\DispatchesCommands trait instead. They work in a very similar fashion.
You can see more details on how to use that trait here: http://laravel.com/docs/5.0/bus

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!

Related

Laravel passport 7.5.1 - Replicating claims

We are having a new error related with laravel/passport: 7.5.1. Today, this library has been working as the last week. But this stops showing this message via Postman:
Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated.
Do someone knows something about this issue?
We don't know how to continue with this...
We're using Laravel 5.7 (we know that...)
We "solved" this temporally downgrading the library lcobucci/jwt from 3.4.0 to 3.3.3.
help me in laravel 5.8
set in composer.json
"laravel/passport": "^7.5",
"lcobucci/jwt": "3.3.2",
and update vendor
composer update
For me downgrading, lcobucci/jwt worked for me. I was currently using 3.4.* but downgraded it to a constant 3.3.3
to downgrade I run the command
composer require lcobucci/jwt 3.3.3
And that was it. But my only concern is I am not certain if this is a temporary or a permanent solution to this issue. But at least it will reboot things up if your system failed cause of that error

I want install phpexcel laravel but phpexcel is abandoned

I want to install phpoffice/phpexcel in My Project.
When composer install or composer update, i receive error:
Package phpoffice/phpexcel is abandoned, you should avoid using it.
Use phpoffice/phpspreadsheet instead.
What is wrong with my project? Please help me. My project use PHP version 7.1.3 and Laravel version 5.7
It means the project is not being maintained. you can still use if you want to.
That message you are getting is just a warning, not an error so there is nothing wrong with your project. So you could ignore the warning and continue using the package with your current code.
However, as the message said you should avoid using it because the package might stop working properly if you decide to update laravel, php or any other dependencies. And if it does stop working or you encountered a bug, there will no code maintainer to help you solve your issue.
In your case, phpoffice/phpspreadsheet package actually provide a useful entry in their documentation to help you migrate to their package, so you should definitely give it a read as there are quite a few breaking changes if you decide to use their package.

Laravel - Problems with updating to Laravel 5.4. Way module share() error

This is regarding Laravel and I am still pretty new to the framework. I recently updated my Laravel to 5.4. And I am running into the following error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Call to undefined method Illuminate\Foundation\Application::share()
Some investigation landed me on one of my vendor module 'Way' is still call share(), which is no longer supported. I did realize that singleton() is the preferred way, but should I even touch the vendor files? Should composer update the vendor Modules as well (especially Way since it is one of the core module)?
Any tips will be greatly appreciated!
Thanks.
laravel 5.4 share has been removed. You will have to use the singleton instead.
See this
https://github.com/laravel/framework/commit/1a1969b6e6f793c3b2a479362641487ee9cbf736
I was able to fix it for now by adjusting the way generator line in composer.json to:
"way/generators": "dev-master"
The library was updated but it is just not included in the composer update.
Just want to post the answer here in case anyone is running into similar issue.
This library does not have support for Laravel 5.4 .
Author referred other library : laracasts/generators. Both the packages are managed by same author.
Check below link : https://github.com/JeffreyWay/Laravel-4-Generators#laravel-5

Laravel 5.2: Class "Illuminate\Html\HtmlServiceProvider" not found during composer installation

So I've been trying to install the LaravelCollective/Html package via composer update (already added "laravelcollective/html": "5.2.*" to the project composer.json file), but I keep getting this...
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Illuminate\Html\HtmlServiceProvider' not found
Script php artisan optimize handling the post-update-cmd event returned with error code 1
It seems I need to update app.php, but only after the install I can't get out of.
Thanks in advance.
(Oh and I'm using Windows, if that's of any importance. And yes, I did look for answers, but most were either relative to people having trouble after install or wrongly assuming they were)
So, I ended up finding the answer myself. I really dislike when I ask for help and end up not needing any, but this answer might be useful for others thinking the same way as I did.
Some answers I looked for said something about using composer dump-autoload after installation. I didn't try this step because I was fixated on the installation failing, and assumed it only worked if the install itself did. But then I decided to go with it, then retried composer update and nothing happened (maybe a sign there was nothing broken to fix). Then I edited the config/app.php file as explained on the docs and, surprisingly, it started working. I still might need to test it a little, but for now it seems nothing's broken.

Zend Framework and Doctrine installation using composer

I came here because I had some issue around the Doctrine ORM install.
I successfully installed the Zend Framework (followed by these steps) and it's works itself on my local machine.
Then I tried to install the Doctrine, (followed by these steps) , but it's doesn't work.
When I solve that problem above, I always got an another one. I tried to check every related question in this site so far (like this one) , but it's still doesn't work.
In my .json file has "minimum-stability": "dev", and I tried either ZF minimal install or advanced one (with more packages).
Here is my .json file:
I have no modification here, when I try to use the require doctrine/doctrine-orm-module:dev-master I've got an error. Also when I typed directly into the .json file, and tried to composer update it.
Every answer will be appreciated!

Categories