Nova filter that displays a Date Range Picker instead of a select.
Run this command in your nova project:
composer require ampeco/nova-date-range-filter
Just use DateRangeFilter class instead of Filter
use Ampeco\Filters\DateRangeFilter;
class DateRange extends DateRangeFilter
{
public function apply(Request $request, $query, $value)
{
$from = Carbon::parse($value[0]);
$to = Carbon::parse($value[1]);
//
return $query;
}
}
Use fluent interface to configure your DateRange filter
(new DateRange)->placeholder("Placeholder")->dateFormat("m d Y")