LaravelPackages.net
Acme Inc.
Toggle sidebar
rosamarsky/nova-range-filter

A Laravel Nova range filter.

25.436
5
1.0.2
About rosamarsky/nova-range-filter

rosamarsky/nova-range-filter is a Laravel package for a laravel nova range filter.. It currently has 5 GitHub stars and 25.436 downloads on Packagist (latest version 1.0.2). Install it with composer require rosamarsky/nova-range-filter. Discover more Laravel packages by rosamarsky or browse all Laravel packages to compare alternatives.

Last updated

Laravel Nova Range Filter

Latest Version on Packagist Total Downloads License: MIT

A clean and simple Laravel Nova filter for selecting values between a minimum and maximum range.
Built on top of vue-slider-component.

RangeFilter


⚙️ Requirements

  • php: >=8.0
  • laravel/nova: ^4.0|^5.0

📦 Installation

composer require rosamarsky/nova-range-filter

🚀 Usage

Register it inside your Nova resource as usual:

use Rosamarsky\RangeFilter\RangeFilter;
use App\Models\Invoice;

class Invoice extends Resource
{
    public function filters(Request $request): array
    {
        return [
            RangeFilter::make('Amount', 'amount', [
                'min' => floor(Invoice::query()->min('amount')),
                'max' => ceil(Invoice::query()->max('amount')),
                'interval' => 10,
            ]),
        ];
    }
}

⚠️ The interval value must be greater than 0 and divide evenly into (max - min).


🧱 Available Options

| Option | Description | Default | |---------------|--------------------------------------------------------------------|-----------| | tooltip | Tooltip display mode: none, always, hover, focus, active | active | | minRange | Minimum distance between handles | — | | maxRange | Maximum distance between handles | — | | clickable | Allow changes by clicking on the slider | true | | disabled | Disable the component | false | | label | Value postfix (e.g. %, $, kg) | — |


📜 License

This package is open-sourced software licensed under the MIT License.

Comments