where('rule_name', 'InvoiceMailAlert') ->value('schedule_type'); switch ($scheduleType) { case 'Live': $schedule->command('send:invoice-report')->everyMinute()->runInBackground(); break; case 'Hourly': $schedule->command('send:invoice-report')->hourly()->runInBackground(); break; // case 'Daily': // $schedule->command('send:invoice-report')->daily()->runInBackground(); //->dailyAt('07:59') // break; case 'Daily': $schedule->command('send:invoice-report')->dailyAt('07:59')->runInBackground(); //->dailyAt('07:59') break; default: $schedule->command('send:invoice-report')->hourly()->runInBackground(); break; } // Production Report Scheduling $productionScheduleType = AlertMailRule::where('module', 'ProductionQuantities') ->where('rule_name', 'ProductionMailAlert') ->value('schedule_type'); switch ($productionScheduleType) { case 'Live': $schedule->command('send:production-report')->everyMinute()->runInBackground(); break; case 'Hourly': $schedule->command('send:production-report')->hourly()->runInBackground(); break; case 'Daily': $schedule->command('send:production-report')->dailyAt('07:59')->runInBackground(); break; default: $schedule->command('send:production-report')->hourly()->runInBackground(); break; } } }