PHPackages                             one-strive/nova-global-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. [Admin Panels](/categories/admin)
4. /
5. one-strive/nova-global-filter

ActiveLibrary[Admin Panels](/categories/admin)

one-strive/nova-global-filter
=============================

This package allows you to broadcast any of your existing Laravel Nova filters to metrics or custom cards.

5.1(4mo ago)11.9k↓40.9%MITVuePHP &gt;=7.1.0

Since Nov 11Pushed 4mo agoCompare

[ Source](https://github.com/OneStrive/nova-global-filter)[ Packagist](https://packagist.org/packages/one-strive/nova-global-filter)[ RSS](/packages/one-strive-nova-global-filter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (6)Used By (0)

Nova Global Filter
==================

[](#nova-global-filter)

This package allows you to emit any of your existing Laravel Nova filters to metrics or custom cards.

> **Note:** This is a community-maintained fork of the original package. We've taken over maintenance of this abandoned package to ensure continued support for the Laravel Nova community. This version is compatible with **Nova 5 only**.

[![screenshot](resources/img/global-filter.png)](resources/img/global-filter.png)

Installation
------------

[](#installation)

You can install the package in to a `Laravel` app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require OneStrive/nova-global-filter
```

Requirements
------------

[](#requirements)

- Laravel Nova 5.x
- PHP 8.1 or higher
- Laravel 10.x or higher

Usage
-----

[](#usage)

In this example, we are registering few `Metric Cards` and the `Global Filter` with a `Date` filter as:

```
...
use OneStrive\NovaGlobalFilter\NovaGlobalFilter;
use App\Nova\Filters\Date;

class Store extends Resource
{
  ...
  public function cards(Request $request)
  {
    return [
      new TotalSales // Value Metric

      new Orders, // Trend Metric

      new MostSoldProduct, // Partition Metric

      // NovaGlobalFilter
      NovaGlobalFilter::make()->filters([
        new Date, // Date Filter
      ]),
    ];
  }
  ...
}
```

And now `metric cards` or any `other cards` optimized to listen `GlobalFilter` can be filtered by using `GlobalFilterable` trait and calling `$this->globalFiltered($model,$filters)` method.

`globalFiltered($model, $filters = [])` method expect `$model` and `$filters` parameters:

```
use OneStrive\NovaGlobalFilter\GlobalFilterable;
use App\Nova\Filters\Date;
...

class UsersPerDay extends Trend
{
use GlobalFilterable;

  public function calculate(NovaRequest $request)
  {
    // Filter your model with existing filters
    $model = $this->globalFiltered($request, Store::class,[
      Date::class // DateFilter
    ]);

    // Do your thing with the filtered $model
    return $this->countByDays($request, $model);

  }
...
}
```

And that's it. Cards will be filtered based on passed filter value.

If you want to apply default value on initial request make sure you set default value in your filter as

```
...
// set default date
public function default()
{
    return Carbon::now();
}
...
```

To change layout from `grid` to `inline`

*by default it's set to `grid`*

```
...
NovaGlobalFilter::make()
    ->filters([
        // Filters
    ]),
...
```

To enable `Reset` button

```
...
NovaGlobalFilter::make()
    ->filters([
        // Filters
    ])
    ->resettable(),
...
```

To add multiple `Global Filter`s

```
...
NovaGlobalFilter::make()
    ->filters([
        // Filters
    ])
    ->inline()
    ->resettable(),

NovaGlobalFilter::make()
    ->filters([
        // Filters
    ])
    ->onlyOnDetail(),
...
```

To set `Title` of Global Filter

```
...
    NovaGlobalFilter::make()
        ->filters([
            // Filters
        ])
        ->title('Example Title'),
...
```

To listen `Global Filter` on any `Custom Card`s:

```
...
created() {
  Nova.$on("global-filter-changed", filter => {
    // Do your thing with the changed filter
    console.log(filter);
  });
},
...
```

To request all filter states from `Global Filter` on any `Custom Card`s:

```
...
  Nova.$emit("global-filter-request");
...
```

To request spesific filters state from `Global Filter` on any `Custom Card`s:

```
...
created() {
  Nova.$emit("global-filter-request", [
      "App\\Nova\\Filters\\DateFilter",
      "App\\Nova\\Filters\\CountryFilter"
  ]);
},
...
```

To receive filters state from `Global Filter` on any `Custom Card`s:

```
...
created() {
  Nova.$on("global-filter-response", filters => {
    // Do your thing with the filters
    console.log(filters);
  });
},
...
```

Good to know
------------

[](#good-to-know)

- Basic functionality of this package is that it listens all the asigned filters. Once a value of a filter is changed, it emits as `Nova.$on('global-filter-changed', [changed filter and value])`. So any card that listens to this event will recieve the filter and its value.
- This package overwrites Nova's default `Metric Card`s to allow them to listen `"global-filter-changed"` event. Make sure there are no any conflicts with other pacages.
- This package currently does not support Index view filters to be synchronized. So filters in `Global Filter` will not trigger update at the filters in `Filter Menu` of your Index view.
- `Reset` button simply reloads the current page. There is nothing fancy going on behind the scenes.
- If you are willing to support this package, it will be great to get your issues, PRs and thoughts on [Github](https://github.com/nemrutco/). And dont forget to `Star` the package.

Credits
-------

[](#credits)

This package is a maintained fork of the original work by:

- [Nemrut Creative Studio](https://nemrut.co)
- [Muzaffer Dede](https://github.com/muzafferdede)

We're grateful for their excellent foundational work and are committed to keeping this valuable tool available for the Nova community.

Current maintainers:

- [All Contributors](../../contributors)

Made with ❤️ for open source

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance74

Regular maintenance activity

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 72.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

Every ~16 days

Total

4

Last Release

140d ago

Major Versions

0.2 → 5.02025-11-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f0a16ae459cb659d603104dc8a8dec3b527483c1c55b8dba0f0272f06c4dfb6?d=identicon)[robertmarney](/maintainers/robertmarney)

---

Top Contributors

[![MuzafferDede](https://avatars.githubusercontent.com/u/5906125?v=4)](https://github.com/MuzafferDede "MuzafferDede (34 commits)")[![ali-raza-saleem](https://avatars.githubusercontent.com/u/88083032?v=4)](https://github.com/ali-raza-saleem "ali-raza-saleem (7 commits)")[![davide-granello](https://avatars.githubusercontent.com/u/82588489?v=4)](https://github.com/davide-granello "davide-granello (3 commits)")[![chrisvasey](https://avatars.githubusercontent.com/u/7483460?v=4)](https://github.com/chrisvasey "chrisvasey (1 commits)")[![cord](https://avatars.githubusercontent.com/u/158588?v=4)](https://github.com/cord "cord (1 commits)")[![robertmarney](https://avatars.githubusercontent.com/u/48888686?v=4)](https://github.com/robertmarney "robertmarney (1 commits)")

---

Tags

laravelMetricsdashboardcardfiltersnova

### Embed Badge

![Health badge](/badges/one-strive-nova-global-filter/health.svg)

```
[![Health](https://phpackages.com/badges/one-strive-nova-global-filter/health.svg)](https://phpackages.com/packages/one-strive-nova-global-filter)
```

###  Alternatives

[digital-creative/nova-dashboard

The missing dashboard for nova.

7169.3k1](/packages/digital-creative-nova-dashboard)[jubeki/nova-card-linkable

A Linkeable Card for the Laravel Nova Dashboard.

19246.1k](/packages/jubeki-nova-card-linkable)[khalin/nova-link-field

A Laravel Nova Link field.

31562.2k2](/packages/khalin-nova-link-field)

PHPackages © 2026

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