Provides the missing range field for the Filament forms.

Overview

The missing range field for the Filament forms.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Installation

You can install the package via composer:

composer require yepsua/filament-range-field

Publish the assets:

php artisan vendor:publish --tag="filament-range-field-assets"

Optionally, you can publish the views using

php artisan vendor:publish --tag="filament-range-field-views"

Basic usage

By default the range is used to get value from 0 to 100.

use Yepsua\Filament\Forms\Components\RangeSlider

...
    protected function getFormSchema(): array
    {
        return [
            ...
            RangeSlider::make('range')
            ...
        ];
    }
...

Defining the steps:

use Yepsua\Filament\Forms\Components\RangeSlider

...
    protected function getFormSchema(): array
    {
        return [
            ...
            RangeSlider::make('range')->steps([
                'A', // should get value: 1 for the A
                'B', // should get value: 2 for the B
                'C', // should get value: 3 for the C
                'D'  // should get value: 4 for the D
            ])
            ...
        ];
    }
...

Associative Array:

use Yepsua\Filament\Forms\Components\RangeSlider

...
    protected function getFormSchema(): array
    {
        return [
            ...
            RangeSlider::make('range')->steps([
                '25'  => 'A', // should get value: 25  for the A
                '50'  => 'B', // should get value: 50  for the B
                '75'  => 'C', // should get value: 75  for the C
                '100' => 'D'  // should get value: 100 for the D
            ])
            ...
        ];
    }
...

Hide the Step List:

use Yepsua\Filament\Forms\Components\RangeSlider

...
    protected function getFormSchema(): array
    {
        return [
            ...
            RangeSlider::make('range')->steps([
                'A',
                'B',
                'C',
                'D'
            ])->displaySteps(false)
            ...
        ];
    }
...

đź“• Note: The step value is defined by the first item in the steps array, Ex. => [25, 50, 75, 100] the step value should be 25. However if you need to define any other step value you can use the setter step.

    RangeSlider::make('range')->steps([
        0 => '0',
        25 => '25',
        50 => '50',
        75 => '75',
        100 => '100'
    ])->step(25)
    ...

The same case applies for the min and max setters:

    RangeSlider::make('range')->min(25)->max(75)->step(5)

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments
Releases(v.0.3.1)
Owner
Soluciones TecnolĂłgicas Yepsua C.A.
null
The Popular Datetime, Flatpickr Picker as a Filament Form Field

Flatpickr Date/Time Picker as a Filament Field Flatpickr is one of the most popular js datepickers. This filament plugin allows you to use flatpickr a

Savannabits 4 Aug 29, 2022
A convenient helper for using the laravel-seo package with Filament Admin and Forms

Combine the power of Laravel SEO and Filament PHP. This package is a convenient helper for using the laravel-seo package with Filament Admin and Forms

Ralph J. Smit 39 Dec 21, 2022
A demo of how to use filament/forms to build a user-facing Form Builder which stores fields in JSON.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Dan Harrin 41 Dec 24, 2022
Filament Plugin to help implement Cloudflare turnstile into your forms.

Filament Turnstile Filament Turnstile, is a plugin to help you implement the Cloudflare turnstile. This plugin uses Laravel Turnstile Behind the scene

Coderflex 5 Jun 12, 2023
Filament-spatie-laravel-activitylog - View your activity logs inside of Filament. ⚡️

View your activity logs inside of Filament. This package provides a Filament resource that shows you all of the activity logs created using the spatie

Ryan Chandler 45 Dec 26, 2022
This package provides a Filament resource to view all Laravel sent emails.

This package provides a Filament resource to view all Laravel outgoing emails. It also provides a Model for the database stored emails. Installation Y

RamĂłn E. Zayas 22 Jan 2, 2023
🧑‍🔬 The missing assertions for your views in your Laravel applications.

Laravel View Assertions The missing assertions for your views in your Laravel applications. Installation You'll have to follow a couple of simple step

Sven Luijten 4 Dec 21, 2022
The missing laravel helper that allows you to inspect your eloquent queries with it's bind parameters

Laravel Query Inspector The missing laravel helper that allows you to ispect your eloquent queries with it's bind parameters Motivations Let's say you

Mouad ZIANI 59 Sep 25, 2022
The Missing Laravel Commands

Made with ❤️ by SecTheater Foundation Artify CheatSheet will be availble soon Laravel is a great framework and it provides us the ability to create ou

Security Theater 91 Oct 13, 2022
Voyager - The Missing Laravel Admin

Voyager - The Missing Laravel Admin Made with ❤️ by The Control Group Website & Documentation: https://voyager.devdojo.com/ Video Tutorial Here: https

PeopleConnect 11.3k Jan 7, 2023
Missing pet flyer - Laravel 4 application

Laravel 4.0 Application - Pet Flyer generator Features This is the source of http://missingpetflyer.com that is deployed to Pagodabox. This applicatio

Maksim Surguy 70 Nov 18, 2022
🖼️ Laravel Nova Field for uploading and cropping images using Slim Image Cropper

??️ Laravel Nova Field for uploading and cropping images using Slim Image Cropper

Marius 5 Apr 2, 2022
This Laravel Nova package adds a Trumbowyg field to Nova's arsenal of fields.

Nova Trumbowyg Field This Laravel Nova package adds a Trumbowyg field to Nova's arsenal of fields. Requirements php: >=8.0 laravel/nova: ^4.0 Installa

outl1ne 3 Sep 25, 2022
Twitter Bootstrap forms for Laravel 5

Twitter Bootstrap Forms for Laravel 5 Simple way to create forms View demo demo repository Custom form controls and shorthand methods for form rows (b

Dmitry Groza 15 Oct 31, 2019
BootstrapForm, forms for Laravel 5

BootstrapForm, forms for Laravel 5 This is a package for simply creating Bootstrap 3 styled form groups in Laravel 5. It extends the normal form build

Dwight Watson 217 Oct 24, 2022
rapyd: crud widgets for laravel. datatable, grids, forms, in a simple package

rapyd-laravel This is a pool of presentation and editing widgets (Grids and Forms) for laravel. Nothing to "generate", just some classes to let you de

Felice Ostuni 875 Dec 29, 2022
Keeping Your Laravel Forms Awake.

Caffeine for Laravel Supporting This Package This is an MIT-licensed open source project with its ongoing development made possible by the support of

GeneaLabs, LLC 839 Dec 22, 2022
Fullstack komponents to write Forms, Queries and Menus in Laravel

kompo.io • Documentation • Demos • Twitter kompo/kompo kompo/kompo is a library of Fullstack Komponents to help you write forms, queries and menus in

Bass El Hachem 107 Dec 5, 2022
A simple profile management page for Filament. ✨

A simple profile page for Filament. This package provides a very simple Profile page that allows the current user to manage their name, email address

Ryan Chandler 65 Jan 5, 2023