Repeater::make('questions')
->label('Questions')
->translateLabel()
->relationship()
->addActionLabel(__('Add question'))
->collapsed()
->schema([
Forms\Components\TextInput::make('name')
->label('Question')
->translateLabel()
->required()
->maxLength(255),
Select::make('required_question')
->label('Required question')
->translateLabel()
->searchable()
->options(function (Get $get) {
$otherQuestions = $get('questions');
// needs to be questions exluding this one
// logic to return data from questions
})
Repeater::make('questions')
->label('Questions')
->translateLabel()
->relationship()
->addActionLabel(__('Add question'))
->collapsed()
->schema([
Forms\Components\TextInput::make('name')
->label('Question')
->translateLabel()
->required()
->maxLength(255),
Select::make('required_question')
->label('Required question')
->translateLabel()
->searchable()
->options(function (Get $get) {
$otherQuestions = $get('questions');
// needs to be questions exluding this one
// logic to return data from questions
})