hasRole('Super Admin') ? true : null; // }); // View::composer('filament-panels::pages.auth.login', function ($view) { // $view->with('forgotPasswordUrl', route('password.request')); // }); Gate::before(function (User $user, string $ability) { return $user->isSuperAdmin() ? true : null; }); // FilamentAsset::register([ // Js::make('chart-js-plugins', Vite::asset('resources/js/filament-chart-js-plugins.js'))->module(), // ]); FilamentAsset::register([ Js::make('chart-js-plugins', Vite::asset('resources/js/filament-chart-js-plugins.js'))->module(), ]); // if (env('APP_MODE') === 'admin') { // FilamentAsset::register([ // Js::make('chart-js-plugins', Vite::asset('resources/js/filament-chart-js-plugins.js'))->module(), // ]); // } // URL::forceScheme('https'); // if (!Type::hasType('citext')) { // Type::addType('citext', \Doctrine\DBAL\Platforms\PostgreSqlPlatform::class); // } Gate::policy(Role::class, RolePolicy::class); Gate::policy(Permission::class, PermissionPolicy::class); ini_set('max_execution_time', 300); // 300 seconds = 5 minutes ini_set('memory_limit', '512M'); // 512MB $schedule = app(Schedule::class); $productionRules = AlertMailRule::where('module', 'ProductionQuantities') ->where('rule_name', 'ProductionMail') ->select('plant', 'schedule_type') ->distinct() ->get(); foreach ($productionRules as $rule) { $type = $rule->schedule_type; $plantId = $rule->plant; $command = $schedule->command('send:production-report', [$type, $plantId]); // ->appendOutputTo(storage_path('logs/scheduler.log')); switch ($type) { case 'Live': $command->everyMinute(); break; case 'Hourly': $command->hourly(); break; case 'Daily': $command->dailyAt('07:59'); break; } } // Invoice report scheduling $invoiceRules = AlertMailRule::where('module', 'InvoiceValidation') ->select('plant', 'schedule_type') ->distinct() ->get(); foreach ($invoiceRules as $rule) { $type = $rule->schedule_type; $plantId = $rule->plant; $command = $schedule->command('send:invoice-report', [$type, $plantId]); switch ($type) { case 'Live': $command->everyMinute(); break; case 'Hourly': $command->hourly(); break; case 'Daily': $command->dailyAt('07:59'); break; } } // Invoice Data Report Scheduling $invoiceDataRules = AlertMailRule::where('module', 'InvoiceDataReport') ->select('plant', 'schedule_type') ->distinct() ->get(); foreach ($invoiceDataRules as $rule) { $type = $rule->schedule_type; $plantId = $rule->plant; $command = $schedule->command('send:invoice-data-report', [$type, $plantId]); switch ($type) { case 'Live': $command->everyMinute(); break; case 'Hourly': $command->hourly(); break; case 'Daily': $command->dailyAt('10:00'); break; } } } }