From 346aaf14388a3031d9e8b16c086cdffcaae1f909 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 25 Nov 2025 17:22:33 +0530 Subject: [PATCH] Added schema line in console.php --- routes/console.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/routes/console.php b/routes/console.php index 888d87c..3b70c39 100644 --- a/routes/console.php +++ b/routes/console.php @@ -4,6 +4,7 @@ use App\Models\AlertMailRule; use Illuminate\Foundation\Inspiring; use Illuminate\Support\Facades\Artisan; use Illuminate\Console\Scheduling\Schedule; +use Illuminate\Support\Facades\Schema; Artisan::command('inspire', function () { $this->comment(Inspiring::quote()); @@ -20,6 +21,8 @@ Artisan::command('inspire', function () { //$schedule->command('report:send-daily-production')->dailyAt('07:59'); + if (Schema::hasTable('alert_mail_rules')) { + //Production report scheduling $productionRules = AlertMailRule::where('module', 'ProductionQuantities') ->where('rule_name', 'ProductionMail') @@ -31,8 +34,8 @@ Artisan::command('inspire', function () { $type = $rule->schedule_type; $plantId = $rule->plant; - $command = $schedule->command('send:production-report', [$type, $plantId]) - ->appendOutputTo(storage_path('logs/scheduler.log')); + $command = $schedule->command('send:production-report', [$type, $plantId]); + //->appendOutputTo(storage_path('logs/scheduler.log')); switch ($type) { case 'Live': @@ -72,7 +75,7 @@ Artisan::command('inspire', function () { } } - //Invoice Data report scheduling + //Invoice Data Report Scheduling $invoiceDataRules = AlertMailRule::where('module', 'InvoiceDataReport') ->select('plant', 'schedule_type') ->distinct() @@ -96,6 +99,7 @@ Artisan::command('inspire', function () { break; } } + } });