From 6c3b00e570133dd04b18724972156b0b5471ffc9 Mon Sep 17 00:00:00 2001 From: Philip Iezzi Date: Thu, 5 Dec 2024 23:26:08 +0100 Subject: [PATCH] Change the default for scheduled command emailOutput() to only send email if output exists --- src/Illuminate/Console/Scheduling/Event.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index 371e2d7018d8..741e890e17fd 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -386,7 +386,7 @@ public function appendOutputTo($location) * * @throws \LogicException */ - public function emailOutputTo($addresses, $onlyIfOutputExists = false) + public function emailOutputTo($addresses, $onlyIfOutputExists = true) { $this->ensureOutputIsBeingCaptured(); @@ -447,7 +447,7 @@ protected function ensureOutputIsBeingCaptured() * @param bool $onlyIfOutputExists * @return void */ - protected function emailOutput(Mailer $mailer, $addresses, $onlyIfOutputExists = false) + protected function emailOutput(Mailer $mailer, $addresses, $onlyIfOutputExists = true) { $text = is_file($this->output) ? file_get_contents($this->output) : '';