Is it possible to realize something like this.

I have models with relationships and want to edit actual values, but input fields are not linked to model values. In SurveyResource edit:
Forms\Components\Section::make()
->schema(function ($record) {
$data = [];
foreach ($record->categories as $category) {
foreach ($category->answers as $answer) {
$data[] = Forms\Components\Group::make()
->schema([
Forms\Components\TextInput::make('answer'),
]);
}
}
return $data;
})
Forms\Components\Section::make()
->schema(function ($record) {
$data = [];
foreach ($record->categories as $category) {
foreach ($category->answers as $answer) {
$data[] = Forms\Components\Group::make()
->schema([
Forms\Components\TextInput::make('answer'),
]);
}
}
return $data;
})
I would appreciate the advice.
0 Replies
No replies yetBe the first to reply to this messageJoin