rosamarsky / nova-range-filter
A Laravel Nova range filter.
Installs: 18 275
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 2
Open Issues: 1
Language:Vue
pkg:composer/rosamarsky/nova-range-filter
Requires
- php: >=8.0
- laravel/nova: ^4.0
This package is auto-updated.
Last update: 2025-10-12 16:21:31 UTC
README
A Laravel Nova filter for picking range between a min/max value. This package based on vue-slider-component.
Requirements
php:>=8.0laravel/nova:^4.0
Installation
You can install the package via composer:
composer require rosamarsky/nova-range-filter
Usage
Use it as usual on the filters methods within your resource class:
use Rosamarsky\RangeFilter\RangeFilter; use App\Models\Invoice as InvoiceModel; class Invoice extends Resource { public function filters(Request $request): array { return [ RangeFilter::make('Amount', 'amount', [ 'min' => floor(InvoiceModel::query()->min()), 'max' => ceil(InvoiceModel::query()->max()), 'interval' => 10, ]), ]; } }
The interval value must be greater than 0 and can be divisible by (max - min).
You also can provide next options:
tooltip- control tooltip display. Defaultactive.none- never display;always- always display;hover- display when the slider get hover;focus- display when the slider has focus;active- display when tooltip have both hover and focus.
minRange,maxRange- minimum and maximum distance between sliders.clickable- allow changes to value by clicking. Default -true;disabled- enable/disable the component. Default -true;label- the postfix of displayed values for marks and tooltips.
License
The MIT License (MIT). Please see License File for more information.
