| Package Data | |
|---|---|
| Maintainer Username: | sash |
| Package Create Date: | 2019-04-05 |
| Package Last Update: | 2024-01-03 |
| Home Page: | |
| Language: | CSS |
| License: | MIT |
| Last Refreshed: | 2025-10-28 03:06:33 |
| Package Statistics | |
|---|---|
| Total Downloads: | 939,520 |
| Monthly Downloads: | 9,934 |
| Daily Downloads: | 440 |
| Total Stars: | 35 |
| Total Watchers: | 1 |
| Total Forks: | 34 |
| Total Open Issues: | 3 |
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])->startOfDay();
$to = Carbon::parse($value[1])->endOfDay();
return $query->whereBetween('created_at', [$from, $to]);
}
/**
* Get the filter's available options.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
// public function options(Request $request)
// {
// return [
// 'firstDayOfWeek' => 0,
// 'separator' => '-',
// 'enableTime' => false,
// 'enableSeconds' => false,
// 'twelveHourTime' => false
// ];
// }
}
Use fluent interface to configure your DateRange filter
(new DateRange)->placeholder("Placeholder")->dateFormat("m d Y")