How to use Conditional Fields in Controller

I want to add a Author select fields when shared_by === user $form->add( Radios::make() ->name('shared_by') ->label('Author') ->border() ->options( Options::make([ Option::make('anonymous', 'Anonymous'), Option::make('bot', 'Bot'), Option::make('user', 'User'), ]) ) );
2 Replies
ifox
ifox9mo ago
You need Twill 3.1 for conditional fields in the form builder. On your author field, use ->connectedTo('shared_by', 'user')
Razvan din berceni
Razvan din berceniOP9mo ago
thank you, will try I try it on a input Call to undefined method A17\Twill\Services\Forms\Fields\Input::connectedTo() oh wait i have twill 3.0 yes, it works, thank you very much!
Want results from more Discord servers?
Add your server