F
Filament8mo ago
Skent

Hide a Repeater element depending on if a value in repeater JSON is null or not

Snippet of my code
Repeater::make('questions')
->addable(false)
->deletable(false)
->reorderable(false)
->schema([
Textarea::make("question")->autosize()
->dehydrated(false)
->readOnly(),
Section::make('Answer')
->schema([
TextInput::make('A')
->dehydrated(false)
->hidden()
->readOnly(),
Repeater::make('questions')
->addable(false)
->deletable(false)
->reorderable(false)
->schema([
Textarea::make("question")->autosize()
->dehydrated(false)
->readOnly(),
Section::make('Answer')
->schema([
TextInput::make('A')
->dehydrated(false)
->hidden()
->readOnly(),
So basically the JSON for the repeater has "question" "A" "B" "C" "D" If A is null I want the A text input to be hidden for example. How would you do this? It is a form in a Resource
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server