TextInput to actual value

Hi. Can someone help me? Is it possible to get working something like below
return $form
->schema(
Wizard::make(
function ($record) {
$steps = [];
// Survey HasMany Categories
foreach ($record->categories as $category) {
$steps[] = Wizard\Step::make($category->name)
->schema(
function ($record) use ($category) {
$questions = [];
// Category HasMany Questions
foreach ($category->questions as $question) {
$questions[] = Forms\Components\TextInput::make($question->name);
// Question HasMany Answers
foreach ($question->answers as $answer) {
$questions[] = Forms\Components\TextInput::make($answer->name);
}
}
return $questions;
}
);
}
return $steps;
}
),
);
return $form
->schema(
Wizard::make(
function ($record) {
$steps = [];
// Survey HasMany Categories
foreach ($record->categories as $category) {
$steps[] = Wizard\Step::make($category->name)
->schema(
function ($record) use ($category) {
$questions = [];
// Category HasMany Questions
foreach ($category->questions as $question) {
$questions[] = Forms\Components\TextInput::make($question->name);
// Question HasMany Answers
foreach ($question->answers as $answer) {
$questions[] = Forms\Components\TextInput::make($answer->name);
}
}
return $questions;
}
);
}
return $steps;
}
),
);
0 Replies
No replies yetBe the first to reply to this messageJoin