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(\'
Maybe this will save some time to someone in the future, for me worked a mix of 2 answers:
use Symfony\Component\Console\Output\StreamOutput;
$stream = fopen("php://output", "w");
Artisan::call('migrate', [
'--path' => 'database/migrations/customer',
'--force' => true,
'--database' => $connectionName
], new StreamOutput($stream));
$callResponse = ob_get_clean();
StreamOutput helps to put the response in buffer and ob functions to get the response.