haythembenkhlifa/radio-slider

A Laravel Nova field.

v1.0.6 2023-02-03 08:59 UTC

This package is auto-updated.

Last update: 2024-03-30 00:38:04 UTC


README

Installation

composer require haythem/radio-slider

Usage

        // NOVA RESOURCE
        use Haythembenkhlifa\RadioSlider\RadioSlider;

        public function fields(Request $request)
        {
            
            // Please note that the radio buttons are grouped by the field name.
              return [
                        RadioSlider::make("Radio Slider", "custom_field")
                            ->setValues(['Not Likely' => 0, 'Maybe' => 'maybe', 'Very likely' => 'very likely'])
                            ->initialValue(4)//this will select the default value if there is nothing on the database.
              ];
        }

Screenshot

Screenshot_3.png

Screenshot_4.png

Screenshot_5.png