PHPackages                             keizah7/custom-date-filter - 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. keizah7/custom-date-filter

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

keizah7/custom-date-filter
==========================

Laravel Nova FIlter Package. Custom date filter

v1.1.0(5y ago)311.4k↓88.9%1MITPHPPHP &gt;=7.1.0

Since Sep 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/keizah7/nova-date-filter)[ Packagist](https://packagist.org/packages/keizah7/custom-date-filter)[ RSS](/packages/keizah7-custom-date-filter/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)DependenciesVersions (7)Used By (0)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d9822d3eb813141a592ecd6e7091f414a230aa65f3a7e29e4b033db899c2f5f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b65697a6168372f637573746f6d2d646174652d66696c7465722e737667)](https://packagist.org/packages/keizah7/custom-date-filter)[![Total Downloads](https://camo.githubusercontent.com/4eac2b75eb2d4d0e6e78b7cb2e615a6fd9588810b8db13606b72069a6f9ff80a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b65697a6168372f637573746f6d2d646174652d66696c7465722e737667)](https://packagist.org/packages/epartment/nova-dependency-container)[![PRs Welcome](https://camo.githubusercontent.com/dd0b24c1e6776719edb2c273548a510d6490d8d25269a043dfabbd38419905da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e737667)](https://camo.githubusercontent.com/dd0b24c1e6776719edb2c273548a510d6490d8d25269a043dfabbd38419905da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e737667)[![Chat](https://camo.githubusercontent.com/1fcbac47956e961039c0fab88ae261f944c8af6bb31d3422ac7205bdc311aaf0/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3632303933353739303836373930363536313f6c6162656c3d63686174)](https://discord.gg/YeJBQrTUT9)[![HitCount](https://camo.githubusercontent.com/b2ec316f9288057069b21b8ed3b1c5bf204a9a19076eec6a5ec80aa5263ecd2c/68747470733a2f2f76696577732e77686174696c656172656e65642e746f6461792f76696577732f6769746875622f6b65697a6168372f6e6f76612d646174652d66696c7465722e737667)](https://camo.githubusercontent.com/b2ec316f9288057069b21b8ed3b1c5bf204a9a19076eec6a5ec80aa5263ecd2c/68747470733a2f2f76696577732e77686174696c656172656e65642e746f6461792f76696577732f6769746875622f6b65697a6168372f6e6f76612d646174652d66696c7465722e737667)[![Forks](https://camo.githubusercontent.com/776209e80b7376d0fa2a1bd2ed02dc87c31c94961a05fcd92fdd3688b771d881/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6b65697a6168372f6e6f76612d646174652d66696c7465723f7374796c653d736f6369616c)](https://camo.githubusercontent.com/776209e80b7376d0fa2a1bd2ed02dc87c31c94961a05fcd92fdd3688b771d881/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6b65697a6168372f6e6f76612d646174652d66696c7465723f7374796c653d736f6369616c)[![Stars](https://camo.githubusercontent.com/dc7b2556107a631bfb4f232ddf1b38ccdeb2f5c71403abbcce625cb7b3a8bcd4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6b65697a6168372f6e6f76612d646174652d66696c7465723f7374796c653d736f6369616c)](https://camo.githubusercontent.com/dc7b2556107a631bfb4f232ddf1b38ccdeb2f5c71403abbcce625cb7b3a8bcd4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6b65697a6168372f6e6f76612d646174652d66696c7465723f7374796c653d736f6369616c)[![Watchers](https://camo.githubusercontent.com/3d5a2f3ad7d094a058026ef9b7d2536e6795cf0ad1358341930d05c937999fdc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f77617463686572732f6b65697a6168372f6e6f76612d646174652d66696c7465723f7374796c653d736f6369616c)](https://camo.githubusercontent.com/3d5a2f3ad7d094a058026ef9b7d2536e6795cf0ad1358341930d05c937999fdc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f77617463686572732f6b65697a6168372f6e6f76612d646174652d66696c7465723f7374796c653d736f6369616c)[![Contributors](https://camo.githubusercontent.com/39460eb00b16e9cf482059976ba9a5b8a1c0a7aaa3935bb7abe3bdcad5b85f07/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6b65697a6168372f6e6f76612d646174652d66696c746572)](https://camo.githubusercontent.com/39460eb00b16e9cf482059976ba9a5b8a1c0a7aaa3935bb7abe3bdcad5b85f07/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6b65697a6168372f6e6f76612d646174652d66696c746572)

Data Filter
===========

[](#data-filter)

Laravel Nova Custom Date Filter

With this package you can set custom date filter `format` and other options, which newest Nova doesn't support.

[![custom date filter](https://github.com/keizah7/nova-date-filter/raw/master/data-filter.png?raw=true)](https://github.com/keizah7/nova-date-filter/blob/master/data-filter.png?raw=true)

Installation
============

[](#installation)

Install your package in any Nova app

```
composer require keizah7/nova-date-filter

```

You may generate a filter using the `nova:filter` command. By default, Nova will place newly generated filters in the `app/Nova/Filters` directory

```
php artisan nova:filter TimestampFilter

```

Extend your filter class with `CustomDateFilter`

```
use Keizah7\CustomDateFilter\CustomDateFilter;

class TimestampFilter extends CustomDateFilter
{
    //
}

```

Once you have defined a filter, you are ready to attach it to a resource. Each resource generated by Nova contains a `filters` method. To attach a filter to a resource, you should simply add it to the array of filters returned by this method:

```
/**
 * Get the filters available for the resource.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return array
 */
public function filters(Request $request)
{
    return [
        new TimestampFilter(),
    ];
}

```

Remove `TimestampFilter` `$component` variable

```
/**
 * The filter's component.
 *
 * @var string
 */
public $component = 'select-filter'; // remove this line

```

After completing these steps you can see date filter in your nova resource.

Usage
-----

[](#usage)

The filter `apply` method is responsible for modifying the query to achieve the desired filter state, so you can modify it as you want or use prepared package methods:

- `byTime`
- `byHour`
- `fromHour`
- `toHour`
- `byDay`
- `fromDay`
- `toDay`

```
/**
 * Apply the filter to the given query.
 *
 * @param  \Illuminate\Http\Request  $request
 * @param  \Illuminate\Database\Eloquent\Builder  $query
 * @param  mixed  $value
 * @return \Illuminate\Database\Eloquent\Builder
 */
public function apply(Request $request, $query, $value)
{
    return $this->byHour($query, 'created_at', $value);
}

```

Settings
--------

[](#settings)

Default filter setings is:

```
'altFormat' => 'Y-m-d H:i'
'dateFormat' => 'Y-m-d H:i'
'enableTime' => true
'enableSeconds' => false
'firstDayOfWeek' => 1

```

You can change them by modify your filter class `options` method:

```
/**
 * Get the filter's available options.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return array
 */
public function options(Request $request)
{
    return [
        'altFormat' => 'Y-m-d H:i:S',
        'dateFormat' => 'Y-m-d H:i:S',
        'enableTime' => true,
        'enableSeconds' => true,
        'firstDayOfWeek' => 7,
    ];
}

```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/keizah7/nova-date-filter/blob/master/LICENSE) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Every ~0 days

Total

3

Last Release

2069d ago

Major Versions

v0.0.0 → v1.0.02020-09-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/74254789f7f44e7fed445f570bb2297f2f61bb5e26cbe5c6c1ee6032c4615dfc?d=identicon)[keizah7](/maintainers/keizah7)

---

Top Contributors

[![keizah7](https://avatars.githubusercontent.com/u/49227202?v=4)](https://github.com/keizah7 "keizah7 (13 commits)")

---

Tags

customdatefilterlaravellaravel-nova-filternovalaraveldatefilternovacustomlaravel-nova-filter

### Embed Badge

![Health badge](/badges/keizah7-custom-date-filter/health.svg)

```
[![Health](https://phpackages.com/badges/keizah7-custom-date-filter/health.svg)](https://phpackages.com/packages/keizah7-custom-date-filter)
```

###  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)
