OwenMelbz / nova-radio-field

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

Add a helper class to radio buttons #2

Closed Diddyy closed 6 years ago

Diddyy commented 6 years ago

This adds a span under the radio button that allows for a description to be added about what the radio button may do.

It is as easy as adding this in public function fields()

RadioButton::make('Administrator type', 'is_super_admin')
                ->options([
                    0 => ['Regular administrator'],
                    1 => ['Super administrator','Super administrators have all administrator permissions and can manage other admins.'],
                ])
                ->stack()
Diddyy commented 6 years ago

Just a note. Helpers will only show if the user does ->stack() otherwise the radio buttons would stack otherwise rendering the option useless.