Give each specialty module a distinct Heroicon-style icon.
Deploy Ladill Care / deploy (push) Successful in 1m2s
Deploy Ladill Care / deploy (push) Successful in 1m2s
Icon names live on the specialty catalog; SVG paths resolve through a shared map and render in sidebar, dashboard, settings, and the specialty shell. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -40,6 +40,33 @@ class SpecialtyModuleService
|
||||
return $catalog[$key] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Heroicon-style icon identifier from the specialty catalog (e.g. bolt, heart).
|
||||
*/
|
||||
public function iconName(string $key): string
|
||||
{
|
||||
$name = (string) ($this->definition($key)['icon'] ?? 'squares-2x2');
|
||||
|
||||
return $name !== '' ? $name : 'squares-2x2';
|
||||
}
|
||||
|
||||
/**
|
||||
* Inline SVG path markup for sidebar / card icons (24×24 outline).
|
||||
*/
|
||||
public function iconSvgPath(string $key): string
|
||||
{
|
||||
$icons = config('care.specialty_icons', []);
|
||||
$name = $this->iconName($key);
|
||||
|
||||
if (is_array($icons) && isset($icons[$name]) && is_string($icons[$name]) && $icons[$name] !== '') {
|
||||
return $icons[$name];
|
||||
}
|
||||
|
||||
return is_array($icons) && isset($icons['squares-2x2']) && is_string($icons['squares-2x2'])
|
||||
? $icons['squares-2x2']
|
||||
: '';
|
||||
}
|
||||
|
||||
public function isDefaultOnPaidPlans(string $key): bool
|
||||
{
|
||||
return (bool) ($this->definition($key)['default_on_paid_plans'] ?? false);
|
||||
|
||||
Reference in New Issue
Block a user