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'); }); }