Skip to content

Commit c25e7b0

Browse files
committed
Fixed so that the cta labels are dynamic and correct
1 parent c8b4edb commit c25e7b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Filament/Form/Fields/Blocks/CallToActionField.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ public function getChildComponents(): array
109109
->columnSpan(4)
110110
->label(function (Get $get) use ($types) {
111111
// get the selected type:
112-
$selectedTypeModel = $get(static::FIELD_CTA_MODEL);
113-
$selectedType = collect($types)->filter(fn (CallToActionType $type) => ! $type->isUrlType() && ! $type->isRouteType() && $type->getModel() === $selectedTypeModel)->first();
112+
$selectedTypeAlias = $get(static::FIELD_CTA_MODEL);
113+
$selectedType = collect($types)->filter(fn (CallToActionType $type) => ! $type->isUrlType() && ! $type->isRouteType() && $type->getAlias() === $selectedTypeAlias)->first();
114114

115115
return $selectedType?->getLabel() ??
116116
trans('filament-flexible-content-blocks::filament-flexible-content-blocks.form_component.content_blocks.call_to_action_entry_id');

0 commit comments

Comments
 (0)