<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
digital-creative / nova-range-input-filter example snippets
use DigitalCreative\RangeInputFilter\RangeInputFilter;
class MyFilter extends RangeInputFilter {
public function apply(NovaRequest $request, $query, $value)
{
$from = data_get($value, 'from');
$to = data_get($value, 'to');
}
}
class ExampleNovaResource extends Resource {
public function filters(NovaRequest $request): array
{
return [
MyFilter::make()
];
}
}
class ExampleNovaResource extends Resource {
public function filters(NovaRequest $request): array
{
return [
MyFilter::make()
->dividerLabel('<>') // control the divider label in between the inputs
->inputType('week') // supports any html input type
->placeholder('From', 'To') // control the placeholder of the inputs
->fromAttributes([ 'min' => 0 ]) // some inputs type like number accepts more attributes like min/max/step etc..
->toAttributes([ 'max' => 100 ])
];
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.