OwenMelbz / nova-radio-field

Provides a radio field for laravel nova with ability to toggle field visibility.
34 stars 31 forks source link

Select field compatibility #6

Open Donkfather opened 5 years ago

Donkfather commented 5 years ago

Hello, First of all thank you for the field. Second of all i think that adding an empty displayUsingLabels() method would be useful in order to make it interchangeable with the select field. In my case i have the following code:

$fieldClass = $field->options->count() < 4 ? RadioButton::class : Select::class;
$result = $fieldClass::make($field->label, $field->field_code)
                    ->displayUsingLabels()
                    ->options($field->options->pluck('label', 'value'));
OwenMelbz commented 4 years ago

Sorry I’m not familiar with the displayUsingLabels()

Are you able to provide a screenshot as to what you mean or a PR that I can merge?