haythembenkhlifa/marks-slider

A Laravel Nova field.

v1.0.3 2022-12-07 09:36 UTC

This package is auto-updated.

Last update: 2024-11-07 13:49:50 UTC


README

Installation

composer require haythem/marks-slider

Usage

        // NOVA RESOURCE
        use Haythembenkhlifa\MarksSlider\MarksSlider;

        public function fields(Request $request)
        {

              return [
                        MarksSlider::make("Marks Slider", "custom_field")
                            ->setValues(['Not Likely' => 0, 'Maybe' => 2, 'Very likely' => 4])
                            ->setStep(2)
                            ->initialValue(4) //this will set the default value if there is nothing on the database.
                            ->showLabels(true),
              ];
        }

Screenshot