Forms\Components\Group::make()
->schema([
Forms\Components\TextInput::make('question')
->label(trans('general.polls.attributes.question'))
->required()
->maxLength(255),
// Answers
Forms\Components\Repeater::make('answers')
->label(trans('general.polls.attributes.answers'))
->relationship('answers')
->simple(
Forms\Components\TextInput::make('name')
->required()
->maxLength(255)
)
->required()
->minItems(2)
->maxItems(5)
])
->relationship('poll')
->columnSpanFull()
->hidden(fn(Get $get) => !$get('options.enable_poll'))
Forms\Components\Group::make()
->schema([
Forms\Components\TextInput::make('question')
->label(trans('general.polls.attributes.question'))
->required()
->maxLength(255),
// Answers
Forms\Components\Repeater::make('answers')
->label(trans('general.polls.attributes.answers'))
->relationship('answers')
->simple(
Forms\Components\TextInput::make('name')
->required()
->maxLength(255)
)
->required()
->minItems(2)
->maxItems(5)
])
->relationship('poll')
->columnSpanFull()
->hidden(fn(Get $get) => !$get('options.enable_poll'))