Laravel 5.4 Artisan Migrate ends with an undefined dispatch () method call

I have a Laravel 5.4 app that works fine locally. When I try to host it on my production server, I cannot perform the migration. Here is the error part:

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 running php artisan --help and I get the same error.

+6
source share
4 answers

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

 php artisan cache:clear php artisan view:clear 

This should fix your problem.

+6
source

I think your composer is not updated. Try removing the composer and then reinstalling it. Or try updating composer.phar. There is probably a problem with the version you are using.

+2
source

Running the “composer update” solved the problem for me.

0
source

I had the same problem and solved it:

  1. connected to my production server.
  2. download cd / cache and delete the compiled.php file by running the rm compiled.php command.
0
source

Source: https://habr.com/ru/post/1263856/


All Articles