I want to create a console command that help me through a site deployment by calling other Artisan commands (a migration, followed by a series of functions that will fill the table with data.)
Artisan::call('migrate', ['--path' => 'database/migrations/'.$filename.'.php']);
foreach($data as $entry){
// Fill the table with data
}
Everything has been tested and works fine in my dev environment, however the migration command appears to be skipped when I try to run this in production. I tried doing the migration manually, and discovered that the console gives me a prompt asking if I'm sure that I want to run the migration in the production environment. Is there a way to modify the Artisan::call('migrate' ...); code so it will answer 'yes' to this prompt during execution? If not, is there another way to get the script to work (possibly setting the env variable to something else while the script is running?)
Edit: Can I fix this at the unix command level (I don't have access to the production environment to test)?
yes | php atrisan command:dothis
This may be the work around I need, however I'd rather be more specific, and provide the yes to the single internal atrisan call