File tree Expand file tree Collapse file tree 4 files changed +0
-52
lines changed Expand file tree Collapse file tree 4 files changed +0
-52
lines changed Original file line number Diff line number Diff line change 44
55abstract class AbstractMenuItemType
66{
7- protected ?string $ icon = null ;
8-
9- public function getIcon (): ?string
10- {
11- return $ this ->icon ;
12- }
13-
14- public function icon (?string $ icon ): static
15- {
16- $ this ->icon = $ icon ;
17-
18- return $ this ;
19- }
20-
217 abstract public function getAlias (): string ;
228
239 public function isUrlType (): bool
Original file line number Diff line number Diff line change @@ -18,14 +18,6 @@ class LinkableMenuItemType extends AbstractMenuItemType
1818 public function __construct (string $ model )
1919 {
2020 $ this ->model = $ model ;
21- $ this ->icon = 'heroicon-o-link ' ;
22-
23- // Set icon based on model if it has a getMorphClass method
24- $ modelInstance = app ($ model );
25- if (method_exists ($ modelInstance , 'getMorphClass ' )) {
26- $ morphClass = $ modelInstance ->getMorphClass ();
27- $ this ->icon = $ this ->getIconForMorphClass ($ morphClass );
28- }
2921 }
3022
3123 public static function make (string $ model ): static
@@ -122,26 +114,6 @@ protected function getHelperText(): string
122114 ]);
123115 }
124116
125- protected function getIconForMorphClass (string $ morphClass ): string
126- {
127- // Check config for exact morph class match
128- $ configuredIcons = FilamentFlexibleContentBlockPages::config ()
129- ->getMenuModelIcons ();
130-
131- if (isset ($ configuredIcons [$ morphClass ])) {
132- return $ configuredIcons [$ morphClass ];
133- }
134-
135- // Fallback to pattern matching for backwards compatibility
136- foreach ($ configuredIcons as $ pattern => $ icon ) {
137- if (str_contains ($ morphClass , $ pattern )) {
138- return $ icon ;
139- }
140- }
141-
142- // Final fallback to default icon
143- return 'heroicon-o-link ' ;
144- }
145117
146118 public function isModelType (): bool
147119 {
Original file line number Diff line number Diff line change @@ -9,11 +9,6 @@ class RouteMenuItemType extends AbstractMenuItemType
99{
1010 const TYPE_ROUTE = 'route ' ;
1111
12- public function __construct ()
13- {
14- $ this ->icon = 'heroicon-o-map ' ;
15- }
16-
1712 public static function make (?string $ model = null ): static
1813 {
1914 return new static ;
Original file line number Diff line number Diff line change @@ -8,11 +8,6 @@ class UrlMenuItemType extends AbstractMenuItemType
88{
99 const TYPE_URL = 'url ' ;
1010
11- public function __construct ()
12- {
13- $ this ->icon = 'heroicon-o-link ' ;
14- }
15-
1611 public static function make (?string $ model = null ): static
1712 {
1813 return new static ;
You can’t perform that action at this time.
0 commit comments