Using radiobox in Laravel Backpack/Setting

547 views Asked by At

Hi I am trying to use radio in Backpack for Laravel. I have the following, but it does not show any radiobox. What am I doing wrong here?

{"name":"value","label":"Value", "title":"Google Auth",
"type":"radio","options":{"0":"Off","1":"On"}}

enter image description here

2

There are 2 answers

0
tabacitu On BEST ANSWER

There was previously an error in the radio field type, but it has been fixed in Backpack\CRUD 3.1.50. A composer update should fix it for you:

enter image description here

0
ninja On

Try this :

$this->crud->addField([
    'name'        => 'value',
    'label'       => 'Value',
    'type'        => 'radio',
    'options'     => [  0 => "Off",
                        1 => "On"
                     ],
]);