infolist: access state of another field and/or access index of repeatable entry

hey folks, i want implement an infolist component which i'm passing data via the state method. no record available. now i want to add an suffix to a field based on the state of another field. i know that within the form builder this is possible using $get. does this exists for infolist too? could not find anything related... my other idea was to build my own livewire component to implement the field + suffix myself. since this is used inside a repeatable entry i would need know the index of the current item/iteration. is this possible?
RepeatableEntry::make('projects')
->schema([
Split::make([
TextEntry::make('name'),
TextEntry::make('foo.value')
->suffix(fn (Get $get) => $get('foo.is_percentage') ? '%' : ''),
TextEntry::make('foo.is_percentage')
->hidden(),
Livewire::make(Bar::class, ['project' => $this->projects[$index]]),
])
])
RepeatableEntry::make('projects')
->schema([
Split::make([
TextEntry::make('name'),
TextEntry::make('foo.value')
->suffix(fn (Get $get) => $get('foo.is_percentage') ? '%' : ''),
TextEntry::make('foo.is_percentage')
->hidden(),
Livewire::make(Bar::class, ['project' => $this->projects[$index]]),
])
])
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server