Skip to content

Commit 5158b26

Browse files
committed
fix: restore getTypeSettingsSchema for custom field type settings
The getTypeSettingsSchema() method was accidentally removed in the revert commit 0147072. This method is essential for custom field types to define their own settings UI (e.g., RepeaterFieldType).
1 parent 4f2d7ac commit 5158b26

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

src/Filament/Management/Schemas/FieldForm.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,34 @@
3434

3535
class FieldForm implements FormInterface
3636
{
37+
/**
38+
* Get type-specific settings schema components.
39+
*
40+
* @return array<int, Component>
41+
*/
42+
private static function getTypeSettingsSchema(): array
43+
{
44+
$components = [];
45+
46+
foreach (CustomFieldsType::toCollection() as $fieldTypeData) {
47+
if ($fieldTypeData->settingsSchema === null) {
48+
continue;
49+
}
50+
51+
$schema = is_callable($fieldTypeData->settingsSchema)
52+
? ($fieldTypeData->settingsSchema)()
53+
: $fieldTypeData->settingsSchema;
54+
55+
foreach ($schema as $component) {
56+
$components[] = $component->visible(
57+
fn (Get $get): bool => $get('type') === $fieldTypeData->key
58+
);
59+
}
60+
}
61+
62+
return $components;
63+
}
64+
3765
/**
3866
* @return array<int, Component>
3967
*
@@ -389,6 +417,9 @@ public static function schema(bool $withOptionsRelationship = true): array
389417
),
390418
]),
391419

420+
// Dynamic type-specific settings from field type definition
421+
...self::getTypeSettingsSchema(),
422+
392423
Select::make('options_lookup_type')
393424
->label(
394425
__(

0 commit comments

Comments
 (0)