How to access the Repeater item?
Hi,
I am trying to access the repeater item.
``php
Forms\Components\Tabs\Tab::make(__('Reduktionen'))->schema([
Forms\Components\Repeater::make('rooms')
->label(__('Zimmer'))
->itemLabel(fn() => 'TODO') // How to access
room`?
->relationship('rooms')
->addable(false)
->deletable(false)
->defaultItems(0)
->schema([...])
]),4 Replies
You must use the $get and $get
The above code is inside a repeater. It assigns a default valu of a field called merit_date which is NOT inside the Repeater
To $get the value of a field in the repeater itself it must be ../field_name or just field_name with no dots and /
Hope it helps.
The repeater is an array of arrays
returns the top-level record. :/
when I add
../*
and above it just returns null
try
The problem is, that
room
is not part of the $state
and I'd like to display the rooms name. π
huh!
It seems to be?
Must have done something wrong before. π
Thank you