Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.4 Artisan Migrate fails with Call to undefined method dispatch()

I have a Laravel 5.4 app that works fine locally. In trying to put it on my production server, I cannot run migrations. Here is part of the error:

PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Illuminate\Events\Dispatcher::dispatch() in /path/to/app/vendor/laravel/framework/src/Illuminate/Console/Application.php:56

Any help is greatly appreciated.

Edit I just tried to run php artisan --help and, I get the same error.

like image 262
Roger Creasy Avatar asked Feb 05 '17 21:02

Roger Creasy


2 Answers

Delete all files from /bootstrap/cache/ and run these commands

php artisan cache:clear
php artisan view:clear

It should fix your problem

like image 173
Daniel Avatar answered Nov 17 '22 16:11

Daniel


I think your composer is not updated. Try uninstalling the composer and then re-installing it. Or try with updating the composer.phar. Probably there is version issue between the laravel you are using.

like image 2
tech_geek Avatar answered Nov 17 '22 17:11

tech_geek