When I run in terminal php artisan migrate
this results in 'Nothing to migrate' when indeed there is nothing to migrate.
When I use Artisan::call('migrate')
in code (use this in a custom Artisan command) this doesn't return any message. It just executes the code without any feedback.
If I vardump()
the result of the Artisan::call
method it just returns an int(0)
Is it possible to get the response of the Artisan call method?
For me with Laravel 5.1 all this did not work but you can simply use:
Artisan::output()
I'm able to get the output of Artisan::call() with the via the following:
use Symfony\Component\Console\Output\StreamOutput;
$stream = fopen("php://output", "w");
Artisan::call("migrate", array(), new StreamOutput($stream));
var_dump($stream);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With