Closed leaderit closed 5 years ago
Fixed:
The core migration commands at Laravel 5.7 have been updated to set the output instance on the migrator class. If you were overriding or extending the migration commands, you should remove references to $this->migrator->getNotes() and use $this->migrator->setOutput($this->output) instead.
Changes in folder "vendor\crestapps\laravel-code-generator\src\Commands\Migrations\" MigrateAllCommand.php ResetAllCommand.php RollbackAllCommand.php
// Fixed:
//$this->migrator->run($this->getMigrationPaths(), [
$this->migrator->setOutput($this->output)->run($this->getMigrationPaths(), [
//$this->migrator->reset(
$this->migrator->setOutput($this->output)->reset(
//$this->migrator->rollback(
$this->migrator->setOutput($this->output)->rollback(
....
//comment/remove this:
// foreach ($this->migrator->getNotes() as $note) {
// $this->output->writeln($note);
// }
Thank you for reporting this issue! This issue has been addressed and now part of the v2.2.13 release. Please upgrade your package to fix the issue
Environment:
Description:
error on migrate-all
Steps/Commands To Reproduce:
bash-3.2$ ./artisan migrate-all
Symfony\Component\Debug\Exception\FatalThrowableError : Call to undefined method Illuminate\Database\Migrations\Migrator::getNotes()
at /Users/vg/devel/web/www/lit-serts/vendor/crestapps/laravel-code-generator/src/Commands/Migrations/MigrateAllCommand.php:56 52| 53| // Once the migrator has run we will grab the note output and send it out to 54| // the console screen, since the migrator itself functions without having 55| // any instances of the OutputInterface contract passed into the class.
Exception trace:
1 CrestApps\CodeGenerator\Commands\Migrations\MigrateAllCommand::handle() /Users/vg/devel/web/www/lit-serts/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
2 call_user_func_array([]) /Users/vg/devel/web/www/lit-serts/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
Please use the argument -v to see more details.
Content Of The Resource-File:
Corrected By:
$this->migrator->setOutput($this->output);
// Next, we will check to see if a path option has been defined. If it has // we will use the path relative to the root of this installation folder // so that migrations may be run for any path within the applications. $this->migrator->run($this->getMigrationPaths(), [ 'pretend' => $this->option('pretend'), 'step' => $this->option('step'), ]);
// foreach ($this->migrator->getNotes() as $note) { // $this->output->writeln($note); // }