Level 88
You get the exit code of the command back. If this is 1 it failed. If it's 0it's successful
$exitCode = Artisan::call('migrate');
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
If I run migration outside of CLI as shown on the snippet below:
Route::get('/migrate',function(){
\Artisan::call('migrate');
});
How can I determine if the migration has completed successfully? Hint: Similar to Laravel 7 error message which gives an option to run migration if table or column not found.
I need this for a project on shared hosting.
You get the exit code of the command back. If this is 1 it failed. If it's 0it's successful
$exitCode = Artisan::call('migrate');
Please or to participate in this conversation.