$get() not finding fields

Good morning, I have a filament form in a modal on a custom livewire page. I have a select field which is dependent on another select field. Nothing crazy, just use GET $get()... Atleast that's what I thought. Because its appearing to not find those fields for some reason. But I have no Idea what's going wrong. It is finding the "answer" field outside of the FieldSection, but all the fields within are simply nowhere to be seen.
Repeater::make($step . '.answers')
->reorderable(false)
->hiddenLabel()
->minItems(1)
->schema([
TextInput::make('answer')
->required(),
Fieldset::make('Filter (Not required)')
->columns(3)
->schema([
Select::make('attributes')
->searchable()
->columnSpan(1)
->native(false)
->options($productAttributes)
->live(),
Select::make('operator')
->columnSpan(1)
->native(false)
->options(FilterOperators::get()),
Select::make('attributeValues')
->searchable()
->columnSpan(1)
->native(false)
->multiple()
->options(function (Get $get) use ($productAttributes) {
$attribute = $get('attributes');
dd($get());
if (!$attribute) {
return ['' => 'no-attribute'];
}

$options = app(GetSiteProductAttributesValues::class)(
site: SiteTenant::current()
attribute: $attribute);

dd($get(), $options, $attribute, $productAttributes);
return $options;
}),
]),
Repeater::make($step . '.answers')
->reorderable(false)
->hiddenLabel()
->minItems(1)
->schema([
TextInput::make('answer')
->required(),
Fieldset::make('Filter (Not required)')
->columns(3)
->schema([
Select::make('attributes')
->searchable()
->columnSpan(1)
->native(false)
->options($productAttributes)
->live(),
Select::make('operator')
->columnSpan(1)
->native(false)
->options(FilterOperators::get()),
Select::make('attributeValues')
->searchable()
->columnSpan(1)
->native(false)
->multiple()
->options(function (Get $get) use ($productAttributes) {
$attribute = $get('attributes');
dd($get());
if (!$attribute) {
return ['' => 'no-attribute'];
}

$options = app(GetSiteProductAttributesValues::class)(
site: SiteTenant::current()
attribute: $attribute);

dd($get(), $options, $attribute, $productAttributes);
return $options;
}),
]),
No description
3 Replies
biebthesecond
biebthesecond6d ago
The picture comes from the dd($get()); As per documentation this gets all accessible fields within the scope https://filamentphp.com/docs/3.x/forms/fields/repeater#using-get-to-access-parent-field-values
ChesterS
ChesterS6d ago
Hmm you have 2 calls to ->schema() ah nvm it's the formatting that makes it look like that
biebthesecond
biebthesecond6d ago
I somehow got this to work using a repeater instead of a fieldset Still the issue is really weird, I have no clue why $get() just couldnt find the fields
Want results from more Discord servers?
Add your server