@php // Define core modules with their routes, icons, and display names $coreModules = [ [ 'name' => 'AccountingCore', 'label' => __('Accounting'), 'route' => 'accountingcore.dashboard', 'icon' => 'bx-calculator', 'color' => 'primary', ], [ 'name' => 'CRMCore', 'label' => __('CRM'), 'route' => 'crmcore.dashboard', 'icon' => 'bx-user-voice', 'color' => 'info', ], [ 'name' => 'PMCore', 'label' => __('Projects'), 'route' => 'pmcore.dashboard.index', 'icon' => 'bx-briefcase', 'color' => 'success', ], [ 'name' => 'WMSInventoryCore', 'label' => __('Inventory'), 'route' => 'wmsinventorycore.dashboard.index', 'icon' => 'bx-package', 'color' => 'warning', ], [ 'name' => 'AICore', 'label' => __('AI'), 'route' => 'aicore.dashboard', 'icon' => 'bx-bot', 'color' => 'secondary', ], [ 'name' => null, // HR is part of the base system, not a module 'label' => __('HR'), 'route' => 'employees.index', 'icon' => 'bx-group', 'color' => 'danger', ], ]; // Filter modules that exist and have valid routes $availableModules = collect($coreModules)->filter(function ($module) { // Check if route exists if (!\Illuminate\Support\Facades\Route::has($module['route'])) { return false; } // If module name is null, it's a base system feature (always available) if ($module['name'] === null) { return true; } // Otherwise check if module exists return moduleExists($module['name']); }); @endphp @if($availableModules->isNotEmpty()) @endif