codicastudio / range-filter
A random Codica Studio package.
Installs: 3
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Vue
Requires
- php: ^7.4 || ^8.0
This package is auto-updated.
Last update: 2024-10-25 14:21:33 UTC
README
A Laravel Nova range input filter.
Installation
You can install the package via composer:
composer require digital-creative/nova-range-input-filter
Basic Usage
Create a filter as usual and extend the DigitalCreative\RangeInputFilter\RangeInputFilter
class
use DigitalCreative\RangeInputFilter\RangeInputFilter; class MyFilter extends RangeInputFilter { public function apply(Request $request, $query, $value) { // $value will always be [ "from" => ?, "to" => ? ] } public function options(Request $request) : array { return [ 'fromPlaceholder' => 0, 'toPlaceholder' => 20, 'dividerLabel' => 'to', ]; } }
and use it as usual on the filters methods within your resource class:
class ExampleNovaResource extends Resource { public function filters(Request $request) { return [ new MyFilter() ]; } }
License
The MIT License (MIT). Please see License File for more information.