File tree Expand file tree Collapse file tree 4 files changed +6
-19
lines changed Expand file tree Collapse file tree 4 files changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -49,17 +49,6 @@ public function searchResultLimit(int $limit): static
49
49
return $ this ;
50
50
}
51
51
52
- public function getSelectField (): Select
53
- {
54
- return Select::make ('linkable_id ' )
55
- ->label (flexiblePagesTrans ('menu_items.form.linkable_item_lbl ' ))
56
- ->searchable ()
57
- ->getSearchResultsUsing (fn (string $ search ): array => $ this ->getSearchResults ($ search ))
58
- ->getOptionLabelUsing (fn ($ value ): ?string => $ this ->getOptionLabel ($ value ))
59
- ->required ()
60
- ->helperText ($ this ->getHelperText ());
61
- }
62
-
63
52
public function getSearchResults (string $ search ): array
64
53
{
65
54
$ modelClass = $ this ->model ;
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ protected static function getLinkableField(): Select
168
168
$ type = static ::getTypeByAlias ($ linkType );
169
169
170
170
if ($ type && $ type ->isModelType () && $ state ) {
171
- $ set (static ::FIELD_LINKABLE_TYPE , $ type ->getModel ());
171
+ $ set (static ::FIELD_LINKABLE_TYPE , $ type ->getAlias ());
172
172
}
173
173
});
174
174
}
@@ -270,6 +270,9 @@ protected static function getModelLabelFromResource(string $modelClass): string
270
270
return class_basename ($ modelClass );
271
271
}
272
272
273
+ /**
274
+ * @return AbstractMenuItemType[]
275
+ */
273
276
protected static function getTypes (): array
274
277
{
275
278
if (static ::$ types === null ) {
Original file line number Diff line number Diff line change @@ -111,9 +111,4 @@ public function isVisible(): bool
111
111
{
112
112
return $ this ->is_visible ;
113
113
}
114
-
115
- public function getTitleAttribute (): string
116
- {
117
- return $ this ->getDisplayLabel ();
118
- }
119
114
}
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ protected function getMenuItemTypeDescription(MenuItem $record): string
126
126
{
127
127
if ($ record ->linkable_type && $ record ->linkable ) {
128
128
// Get model label from Filament resource if available
129
- $ modelLabel = $ this ->getModelLabelFromResource ($ record ->linkable_type );
129
+ $ modelLabel = $ this ->getModelLabelFromResource ($ record ->linkable ::class );
130
130
131
131
return flexiblePagesTrans ('menu_items.tree.linked_to ' ).' ' .$ modelLabel ;
132
132
} elseif ($ record ->url ) {
@@ -194,7 +194,7 @@ public function getTreeRecordIcon(?\Illuminate\Database\Eloquent\Model $record =
194
194
195
195
// Return appropriate icon based on type
196
196
if ($ record ->linkable_type && $ record ->linkable ) {
197
- return $ this ->getModelIconFromResource ($ record ->linkable_type ) ?: 'heroicon-o-link ' ;
197
+ return $ this ->getModelIconFromResource ($ record ->linkable ::class ) ?: 'heroicon-o-link ' ;
198
198
}
199
199
200
200
if ($ record ->url ) {
You can’t perform that action at this time.
0 commit comments