From 1b77e572240789897032a597bccba89c54deca28 Mon Sep 17 00:00:00 2001 From: paoloar77 Date: Fri, 17 May 2024 14:34:41 +0200 Subject: [PATCH] startday --- app/Console/Commands/StartDay.php | 78 +++++++++++++++++++++++++++++++ app/Console/Kernel.php | 9 ++-- 2 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 app/Console/Commands/StartDay.php diff --git a/app/Console/Commands/StartDay.php b/app/Console/Commands/StartDay.php new file mode 100644 index 00000000..09760443 --- /dev/null +++ b/app/Console/Commands/StartDay.php @@ -0,0 +1,78 @@ +getMessage(); + echo "Error: " . $e->getMessage(); + } + + echo $log; + + Log::channel('testpao')->notice($log); + + if (true) { + // Send the email + Mail::raw($log, function ($message) { + $message->to(Mylog::getEmail()); + $message->subject(Mylog::getSubjectEmail("STARTDAY")); + }); + } + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 4d184a7a..f520ae82 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -25,7 +25,7 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { - + Log::info('Controllo schedule...'); // $schedule->command('inspire')->hourly(); $schedule->command('backup:clean')->daily()->at('02:00')->before(function () { @@ -46,11 +46,10 @@ class Kernel extends ConsoleKernel $schedule->command('product:updateqta')->everyFiveMinutes()->between('8:00', '00:00')->withoutOverlapping()->before(function () { Log::info('Running product:updateqta command'); }); - $schedule->command('product:testpao') - ->everyFiveMinutes() - ->between('8:00', '00:00') + $schedule->command('product:startday') + ->daily()->at('08:00') ->before(function () { - Log::info('Running product:testpao command'); + Log::info('Running product:startday command'); }); }