Skent
Skent
FFilament
Created by Skent on 3/18/2024 in #❓┊help
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
2 replies
FFilament
Created by Skent on 2/21/2024 in #❓┊help
Get form values in beforeCreate() hook
So I have a resource and in the create the user is presented with two radio options "Property" with option X and Y and "Vehicle" with option X and Y Before the record is created I want to make sure the user has picked either 1 Property or 1 Vehicle (One in each cannot be selected only one across both radio options) Is there a way to do this in validation (if its easier) Otherwise how do I access these values in the beforeCreate() hook as that's how I was going to check but cant figure out to get their values.
3 replies