'',
'users' => '',
'contacts' => '',
'products' => '',
'warehouse' => '',
'purchase' => '',
'sale' => '',
'pos' => '',
'expense' => '',
'account' => '',
'accounting' => '',
'report' => '',
'settings' => '',
'backup' => '',
'modules' => '',
'notification' => '',
'dashboard' => '',
'project' => '',
'task' => '',
'briefcase' => '',
'wrench' => '',
'toolbox' => '',
'utility' => '',
'equipment' => '',
'category' => '',
'calendar' => '',
'checklist' => '',
'spare' => '',
'truck' => '',
'chat' => '',
'video' => '',
'factory' => '',
'diagram' => '',
'exchange' => '',
'crm' => '',
'portal' => '',
'plug' => '',
'qrcode' => '',
'spreadsheet' => '',
'ticket' => '',
'skill' => '',
'score' => '',
'team' => '',
'health' => '',
'map' => '',
'import' => '',
'label' => '',
'brand' => '',
'subscription' => '',
'shield' => '',
'history' => '',
'filter' => '',
'folder' => '',
'megaphone' => '',
'payment' => '',
'chip' => '',
'dots' => '',
'share' => '',
'file' => '',
'list' => '',
'clock' => '',
'default' => '',
];
protected static array $urlHints = [
'dashboard' => 'dashboard',
'users' => 'users',
'roles' => 'shield',
'sales-commission-agents' => 'team',
'supplier' => 'contacts',
'customer' => 'contacts',
'customer-group' => 'category',
'contacts' => 'contacts',
'products' => 'products',
'variation-templates' => 'category',
'import-products' => 'import',
'import-opening-stock' => 'import',
'import-contacts' => 'import',
'import-sales' => 'import',
'labels' => 'label',
'selling-price-group' => 'sale',
'update-product-price' => 'sale',
'units' => 'category',
'taxonomies' => 'category',
'brands' => 'brand',
'warranties' => 'shield',
'inventorymanagement' => 'warehouse',
'stock-transfers' => 'exchange',
'stock-adjustments' => 'warehouse',
'stock-report' => 'report',
'stock-adjustment-report' => 'report',
'business-location' => 'map',
'purchase-requisition' => 'purchase',
'purchase-order' => 'purchase',
'purchases' => 'purchase',
'purchase-return' => 'purchase',
'sales-order' => 'sale',
'sells' => 'sale',
'pos' => 'pos',
'drafts' => 'file',
'quotations' => 'file',
'sell-return' => 'exchange',
'shipments' => 'truck',
'discount' => 'sale',
'subscriptions' => 'subscription',
'expenses' => 'expense',
'expense-categories' => 'category',
'account' => 'account',
'accounting' => 'accounting',
'chart-of-accounts' => 'accounting',
'journal-entry' => 'file',
'opening-balance' => 'accounting',
'transfer' => 'exchange',
'transactions' => 'accounting',
'budget' => 'report',
'cheques' => 'payment',
'installments' => 'payment',
'depreciation' => 'report',
'fiscal-periods' => 'calendar',
'reconciliations' => 'checklist',
'deferred-documents' => 'file',
'bank-loans' => 'payment',
'insurance' => 'shield',
'payroll-tax-table' => 'report',
'payroll' => 'payment',
'reports' => 'report',
'profit-and-loss' => 'report',
'balance-sheet' => 'report',
'cash-flow' => 'report',
'subsidiary-ledger' => 'report',
'gl-tax' => 'report',
'backup' => 'backup',
'manage-modules' => 'modules',
'notification-templates' => 'notification',
'bookings' => 'calendar',
'kitchen' => 'factory',
'orders' => 'list',
'business' => 'settings',
'invoice-schemes' => 'file',
'invoice-layouts' => 'file',
'barcodes' => 'qrcode',
'printers' => 'settings',
'tax-rates' => 'report',
'tables' => 'category',
'modifiers' => 'list',
'types-of-service' => 'list',
'maintenance' => 'wrench',
'equipment' => 'equipment',
'equipment-categories' => 'category',
'production-lines' => 'factory',
'preventive-schedules' => 'calendar',
'overhauls' => 'wrench',
'rebuilds' => 'factory',
'work-orders' => 'checklist',
'spare-parts' => 'spare',
'inspection-visits' => 'checklist',
'failure-reports' => 'report',
'service-records' => 'history',
'part-replacements' => 'exchange',
'checklist-templates' => 'checklist',
'part-catalogs' => 'spare',
'service-providers' => 'team',
'tools' => 'utility',
'field-missions' => 'map',
'dispatch-board' => 'dashboard',
'repair-dispatches' => 'truck',
'service-contracts' => 'file',
'health' => 'health',
'settings' => 'settings',
'calendar' => 'calendar',
'professional-project' => 'briefcase',
'projects' => 'project',
'tasks' => 'task',
'task-statuses' => 'checklist',
'management-tools' => 'briefcase',
'daily-reports' => 'report',
'skills' => 'skill',
'executive-cockpit' => 'dashboard',
'report-analytics' => 'report',
'project-categories' => 'folder',
'task-report' => 'report',
'scores' => 'score',
'score-cards' => 'score',
'my-scores' => 'score',
'urgent-messages' => 'notification',
'team' => 'team',
'tickets' => 'ticket',
'industrial-engineering' => 'diagram',
'item-masters' => 'spare',
'products' => 'products',
'production-lines' => 'factory',
'boms' => 'diagram',
'cost-scenarios' => 'report',
'release-packages' => 'file',
'serialized-units' => 'qrcode',
'installed-assets' => 'equipment',
'serial-search' => 'qrcode',
'sourcing' => 'exchange',
'competitive-intel' => 'report',
'asset-exchange' => 'exchange',
'listings' => 'megaphone',
'appraisals' => 'checklist',
'deals' => 'payment',
'offers' => 'sale',
'pipeline' => 'diagram',
'research-cases' => 'folder',
'price-inquiries' => 'report',
'tms' => 'truck',
'communication' => 'chat',
'chat' => 'chat',
'meetings' => 'video',
'crm' => 'crm',
'portal' => 'portal',
'project' => 'project',
'asset' => 'equipment',
'hrm' => 'team',
'essentials' => 'checklist',
'manufacturing' => 'factory',
'repair' => 'wrench',
'connector' => 'plug',
'docs' => 'file',
'spreadsheet' => 'spreadsheet',
'product-catalogue' => 'qrcode',
'woocommerce' => 'sale',
'cms' => 'portal',
'superadmin' => 'shield',
'subscription' => 'subscription',
'activity-log' => 'history',
'map' => 'map',
'filter' => 'filter',
'utilities' => 'utility',
'utility' => 'utility',
];
public static function svg(string $name, string $class = self::SVG_CLASS): string
{
$paths = self::$paths[$name] ?? self::$paths['default'];
return '';
}
public static function child(string $name): string
{
return self::svg($name, 'tw-size-4 tw-shrink-0 sidebar-child-icon');
}
public static function resolveFromUrl(?string $url): string
{
if (empty($url) || $url === '#') {
return self::child('default');
}
$path = trim((string) parse_url($url, PHP_URL_PATH), '/');
$segments = array_values(array_filter(explode('/', $path)));
if (str_contains($path, 'management-tools/tools')) {
return self::child('toolbox');
}
if (str_contains($path, 'maintenance/tools')) {
return self::child('utility');
}
foreach (array_reverse($segments) as $segment) {
$segment = strtolower(preg_replace('/[^a-z0-9\-]/', '', $segment) ?? $segment);
if (isset(self::$urlHints[$segment])) {
return self::child(self::$urlHints[$segment]);
}
}
foreach ($segments as $segment) {
$segment = strtolower(preg_replace('/[^a-z0-9\-]/', '', $segment) ?? $segment);
if (isset(self::$urlHints[$segment])) {
return self::child(self::$urlHints[$segment]);
}
}
if (! empty($segments[0]) && isset(self::$urlHints[$segments[0]])) {
return self::child(self::$urlHints[$segments[0]]);
}
return self::child('default');
}
}