PHPackages                             pjhile/daterangepicker - 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. pjhile/daterangepicker

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

pjhile/daterangepicker
======================

A simple Date Range filter for Laravel Nova 4/5 that respects Nova sorting. Forked from the original rpj/daterangepicker package.

v1.0.0(4mo ago)03MITPHPPHP &gt;=8.1

Since Dec 15Pushed 4mo agoCompare

[ Source](https://github.com/pjhile/simple-daterange-picker)[ Packagist](https://packagist.org/packages/pjhile/daterangepicker)[ Fund](https://www.buymeacoffee.com/rodrigopaco)[ RSS](/packages/pjhile-daterangepicker/feed)WikiDiscussions main Synced 1mo ago

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

Simple Date Range Filter for Laravel Nova 4/5
---------------------------------------------

[](#simple-date-range-filter-for-laravel-nova-45)

A filter for Nova that displays a Date Range Picker instead of a single date picker using [Daterangepicker library](https://www.daterangepicker.com/)

Forked from the original rpj/daterangepicker package in order to respect Nova's internal sorting.

### Install

[](#install)

Run this command in your nova project: `composer require pjhile/daterangepicker`

### How to use

[](#how-to-use)

In your Nova resource, just add DateRangeFilter class in the filters function, and include the column(s) that you would like to use as filter the resource.

```
 use Pjhile\Daterangepicker\Daterangepicker;

 public function filters(Request $request)
    {
        return [
            new Daterangepicker('created_at'),
        ];
    }
```

Column name can be a string or an array of strings with two items. Otherwise an exception will be fired.

```
 use Pjhile\Daterangepicker\Daterangepicker;

 public function filters(Request $request)
    {
        return [
            new Daterangepicker(['created_at', 'updated_at']),
        ];
    }
```

Also, you can pass a string with default date range to use in the component. If no value is passed, TODAY value is set as default, but if you want to remove the date filter to show all records, you can use DateHelper::ALL

Additionally, we added a custom date range picker that allows user to specify the column to order by with its value and as well as in the case of a joined table to prevent ambiguous mysql error, you can specify the actual table name to know the actual column you are referring to. this takes, the column to check the date range picker and as well as the column to order by with the asc/desc direction.

```
use Pjhile\Daterangepicker\Daterangepicker;
use Pjhile\Daterangepicker\DateHelper;

public function filters(Request $request)
{
    return [
        new Daterangepicker('users.created_at', DateHelper::THIS_WEEK, 'users.name', 'desc'),
    ];
}
```

Finally, we have added the option to set a custom pre set dates using Carbon class. Also you can set a min and max date for the date range component.

```
use Pjhile\Daterangepicker\Daterangepicker;
use Pjhile\Daterangepicker\DateHelper;
use Carbon\Carbon;

public function filters(Request $request)
{
    return [
        (new Daterangepicker(
            'users.created_at',
            DateHelper::THIS_WEEK,
            'users.name',
            'desc'
        ))
        ->setRanges([
            'Today' => [Carbon::today(), Carbon::today()],
            'Yesterday' => [Carbon::yesterday(), Carbon::yesterday()],
            'This week' => [Carbon::now()->startOfWeek(), Carbon::now()->endOfWeek()],
            'This month' => [Carbon::now()->startOfMonth(), Carbon::now()->endOfMonth()],
            'Last month' => [Carbon::now()->subMonth()->startOfMonth(),Carbon::now()->subMonth()->endOfMonth()],
        ])
        ->setMaxDate(Carbon::today())
        ->setMinDate(Carbon::today()->endOfYear()),
    ];
}
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance74

Regular maintenance activity

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

147d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f056b7449dd88092d850cdb9503ef5ed928f8d8c5a7db5f280b25ff5326743b?d=identicon)[pjhile](/maintainers/pjhile)

---

Top Contributors

[![rodrigopaco1986](https://avatars.githubusercontent.com/u/4001727?v=4)](https://github.com/rodrigopaco1986 "rodrigopaco1986 (13 commits)")[![pjhile](https://avatars.githubusercontent.com/u/224067?v=4)](https://github.com/pjhile "pjhile (2 commits)")[![matthewnessworthy](https://avatars.githubusercontent.com/u/5653887?v=4)](https://github.com/matthewnessworthy "matthewnessworthy (1 commits)")

---

Tags

laraveldatefilterdaterangenova

### Embed Badge

![Health badge](/badges/pjhile-daterangepicker/health.svg)

```
[![Health](https://phpackages.com/badges/pjhile-daterangepicker/health.svg)](https://phpackages.com/packages/pjhile-daterangepicker)
```

###  Alternatives

[ampeco/nova-date-range-filter

A Laravel Nova date range filter.

35988.8k1](/packages/ampeco-nova-date-range-filter)[pos-lifestyle/laravel-nova-date-range-filter

A Laravel Nova date range filter.

16179.1k](/packages/pos-lifestyle-laravel-nova-date-range-filter)[marshmallow/nova-date-range-filter

A Laravel Nova date range filter.

12228.5k](/packages/marshmallow-nova-date-range-filter)[outl1ne/nova-detached-filters

This Laravel Nova package allows you to detach filters from the filter dropdown

64343.5k](/packages/outl1ne-nova-detached-filters)[outl1ne/nova-input-filter

An input filter for Laravel Nova

24822.7k](/packages/outl1ne-nova-input-filter)[suenerds/nova-searchable-belongs-to-filter

Searchable Nova filter for belongsTo relationships.

29516.9k](/packages/suenerds-nova-searchable-belongs-to-filter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
