Get response from Artisan call

后端 未结 7 1377
情深已故
情深已故 2021-02-18 22:56

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(\'

7条回答
  •  离开以前
    2021-02-18 23:11

    Late but might be of use to someone searching for the use case.

    Let me add how i did it in my tests to print the results to console. my problem was printing output while tests are running migrations. i was using modules and wanted to see the results of the migration process.

    $this->artisan('module:migrate');
    //same as running php artisan module:migrate or
    // $this->app['Illuminate\Contracts\Console\Kernel']->call('module:migrate');
    
    echo $this->app['Illuminate\Contracts\Console\Kernel']->output();
    

提交回复
热议问题