Jun 13, 2021
0
Level 6
How to handle exceptions thrown by Artisan:call()
Hello,
I am trying to automate running the migrations when hosting my app on Google Cloud App Engine and Cloud Build.
One option is to curl into an endpoint that runs the migration by code. (If you have other options to run migrations on Google App Engine, please do share with me).
Now, Inside the endpoint controller, I will have something similar to this:
try {
...
Artisan::call('migrate', [
'--force' => true
]);
} catch (Exception $e) {
Response::make($e->getMessage(), 500);
}
Is it enough to have a try/catch block to handle problems with the Artisan command to run the migrations?
I appreciate your feedback.
Thanks Bill
Please or to participate in this conversation.