PHPackages                             sinensia/nova-range-filter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. sinensia/nova-range-filter

ActiveLibrary[Search &amp; Filtering](/categories/search)

sinensia/nova-range-filter
==========================

A reusable range filter component for Laravel Nova with input masking and formatting.

v1.0.2(1y ago)09MITVuePHP ^7.3|^8.0

Since Apr 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/SINENSIA/nova-range-filter)[ Packagist](https://packagist.org/packages/sinensia/nova-range-filter)[ RSS](/packages/sinensia-nova-range-filter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

README.md

Laravel Nova Range Filter
=========================

[](#laravel-nova-range-filter)

A customizable range filter for Laravel Nova that supports masked input, number formatting (currency/decimal), and optional validation. Built with [IMask.js](https://imask.js.org/) and designed to work seamlessly within Nova's filters sidebar.

Features
--------

[](#features)

- Supports min/max range filters
- Dynamic formatting using `Intl.NumberFormat`
- Currency/decimal styles
- Optional negative values
- Built-in validation (`min` cannot be greater than `max`)
- Reacts to Nova's filter reset event

Installation
------------

[](#installation)

```
composer require sinensia/nova-range-filter
```

Then publish the frontend assets:

```
php artisan nova:publish
```

Usage
-----

[](#usage)

In your Nova resource:

```
use Sinensia\NovaRangeFilter\RangeFilter;

public function filters(Request $request)
{
    return [
        (new RangeFilter('Price', 'price'))->withMeta([
            'unit' => 'EUR',
            'format' => 'currency', // or 'decimal'
            'locale' => 'es-ES',
            'allowNegative' => false,
        ]),
    ];
}
```

Customization
-------------

[](#customization)

You can customize the behavior using the `meta()` options:

OptionTypeDescription`unit`stringCurrency code (e.g. `USD`, `EUR`)`format`string`'currency'` or `'decimal'``locale`stringLocale string (e.g. `en-US`, `es-ES`)`allowNegative`booleanAllow negative numbersDevelopment
-----------

[](#development)

To modify or extend this component:

```
cd nova-components/RangeFilter
npm install
npm run dev
```

Basic Example
-------------

[](#basic-example)

This is a simple usage of the `NovaRangeFilter` to filter Eloquent records by a numeric field (e.g., price). It applies a `whereBetween` clause to a single numeric column.

### Example implementation

[](#example-implementation)

```
