diff --git a/app/Console/Commands/QuestionCommand.php b/app/Console/Commands/QuestionCommand.php index 42cebd5..4697b47 100644 --- a/app/Console/Commands/QuestionCommand.php +++ b/app/Console/Commands/QuestionCommand.php @@ -12,12 +12,13 @@ class QuestionCommand extends Command public function handle(): void { - try { - $answer = $this->ask('Do you want to alert users of high heart risk? Only do this when the heart risk calculations have changed. (y/n)'); - } catch (\Exception $e) { + $answer = $this->ask('Do you want to alert users of high heart risk? Only do this when the heart risk calculations have changed. (y/n)'); + + if (! isset($answer)) { $this->error('Run from the command line.'); } + if (in_array($answer, ['y', 'Y', '1', 'yes'])) { $this->info('Show notification'); } else {