Akshay Bokade
Infolist Custom ViewEntry added form field validation.
@Dan Harrin Maybe this will clear the picture,
https://discord.com/channels/883083792112300104/1206537836216451123
Here, when we click on the action the data present in the repeatable entry is getting wiped out.
13 replies
Why this RepeatableEntry code doesn't work as expected
@ElCoco I am having same issue. You can do this also like,
->action(function (array $data, $record) {
dd($record);
But the problem is, if there are more than one records, it returns the last one only.
Do you know how to overcome this issue?
5 replies
Copy contents of first repeater fields to another
@krekas Can you please show me how. Let say this is my code inside repeater
Forms\Components\Textarea::make('home_address.address1')
->label('Address 1')
->required(),
Forms\Components\Textarea::make('home_address.address2')
->label('Address 2'),
11 replies
how can I hide a form field in first repeater
@pboivin
public function form(Form $form): Form
{
$formSpecificComponents = [
Forms\Components\Grid::make(3)
->schema(
[
Forms\Components\TextInput::make('firstname')
->required()
->label('Firstname')
->required()
->maxLength(255)
->live(),
Forms\Components\TextInput::make('lastname')
->required()
->label('Lastname')
->maxLength(255)
->live(),
Forms\Components\Select::make('country')
->options(Country::all()->pluck('name', 'id'))
->searchable()
->required(),
Forms\Components\Select::make('relationship_with_main')
->label('Relationship with main user')
->options(config('app.relationships'))
->required()
->hidden(function() {
static $row = 0;
return ++$row === 1;
}),
Forms\Components\Toggle::make('primary')
->label('Primary Applicant')
->inline(false)
->disabled()
->dehydrated()
]
),
];
return $form->schema($this->baseFormSchema($formSpecificComponents));
}
14 replies