PHPackages                             beyondcode/nova-filterable-cards - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. beyondcode/nova-filterable-cards

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

beyondcode/nova-filterable-cards
================================

Filterable metric cards for Laravel Nova.

0.0.1(7y ago)558.2k20[10 PRs](https://github.com/beyondcode/nova-filterable-cards/pulls)MITVuePHP &gt;=7.1.0

Since Aug 26Pushed 5y ago4 watchersCompare

[ Source](https://github.com/beyondcode/nova-filterable-cards)[ Packagist](https://packagist.org/packages/beyondcode/nova-filterable-cards)[ RSS](/packages/beyondcode-nova-filterable-cards/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (10)Used By (0)

Nova Filterable Metric Cards
============================

[](#nova-filterable-metric-cards)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e52f9a972c3bb10685641a39056d9165507e1869a0b01e261968225b0f3479da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6265796f6e64636f64652f6e6f76612d66696c74657261626c652d63617264732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/beyondcode/nova-filterable-cards)[![Total Downloads](https://camo.githubusercontent.com/3d1f683f83410a496bbf285772095ba636078e458ba4b696f573ed9de85d2542/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6265796f6e64636f64652f6e6f76612d66696c74657261626c652d63617264732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/beyondcode/nova-filterable-cards)[![Build Status](https://camo.githubusercontent.com/bc553c33c70adf2b80fc5a937d57aa24daf64c28da2ac37ac1cff7089986849d/68747470733a2f2f7472617669732d63692e6f72672f6265796f6e64636f64652f6e6f76612d66696c74657261626c652d63617264732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/beyondcode/nova-filterable-cards)

Add custom filters to your Laravel Nova metrics.

[![screenshot](https://camo.githubusercontent.com/353e43837f50b1baf718e083144200d4b1879aab7e96c18bacd262160c79a7cf/68747470733a2f2f6265796f6e64636f2e64652f6769746875622f6e6f76612d66696c74657261626c652d63617264732f73637265656e73686f742e706e67)](https://camo.githubusercontent.com/353e43837f50b1baf718e083144200d4b1879aab7e96c18bacd262160c79a7cf/68747470733a2f2f6265796f6e64636f2e64652f6769746875622f6e6f76612d66696c74657261626c652d63617264732f73637265656e73686f742e706e67)[![screenshot](https://camo.githubusercontent.com/b16ad3bfe48dad9d3a0d64ccf5fc810371644eb075f0a3d59bd3f0745f67c28b/68747470733a2f2f6265796f6e64636f2e64652f6769746875622f6e6f76612d66696c74657261626c652d63617264732f73637265656e73686f74312e706e67)](https://camo.githubusercontent.com/b16ad3bfe48dad9d3a0d64ccf5fc810371644eb075f0a3d59bd3f0745f67c28b/68747470733a2f2f6265796f6e64636f2e64652f6769746875622f6e6f76612d66696c74657261626c652d63617264732f73637265656e73686f74312e706e67)

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

[](#installation)

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

```
composer require beyondcode/nova-filterable-cards
```

Usage
-----

[](#usage)

To add the filter ability to your Laravel Nova metric cards, you need to add one of the `Filterable` traits to your metrics.

Depending on your metric type, these are the available traits:

- `FilterableValue`
- `FilterableTrend`
- `FilterablePartition`

For example, within your custom Nova value metric card:

```
// in your Nova value metric card class:
import Beyondcode\FilterableCard\FilterableValue;

use FilterableValue;
```

Defining Filters
----------------

[](#defining-filters)

The available filters for your cards can be defined, by adding a new property called `$filters` to your metrics. This must be an array and contains the names of the available filters, as well as the properties for this specific filter.

Example:

```
// in your filterable Nova metric card class:

protected $filters = [
	'Firstname' => [
		'type' => 'text'
	],
	'Status' => [
		'type' => 'select',
		'options' => [
			'all' => 'All',
			'active' => 'Active',
			'inactive' => 'Inactive'
		],
	]
];
```

### Defining Filters Using Define Methods

[](#defining-filters-using-define-methods)

Sometimes you might want to set the available filter options by using a database call, or load them from the configuration. To enable this, you can also define the filter options using a method with the following naming convention: `defineStudlyCaseFilterName`.

So for example, if you want to add and define a custom filter called `User Status`, you can do it like this:

```
// in your filterable Nova metric card class:

protected $filters = [
	'Firstname' => [
		'type' => 'text'
	],
	'User Status'
];

public function defineUserStatus()
{
	return [
		'type' => 'select',
		'options' => [
			'all' => 'All',
			'active' => 'Active',
			'inactive' => 'Inactive'
		],
	];
}
```

### Available Filter Types

[](#available-filter-types)

The available filter types are:

- `select`
- `checkbox`
- `text`
- `email`
- `url`
- `number`

And all other types that can be applied to HTML `` tags.

### Apply The Filter Logic

[](#apply-the-filter-logic)

To define in which way you want to filter your custom metric query, once a user filters it using the modal, you need to define custom filter methods. The naming convention is similar to defining custom filter options. It's `filterStudlyCaseFilterName`.

This method receives a query builder object and the value of the filter input. You can add your own queries to the builder class and modify as you need. Just make sure that you return the query object.

Example:

```
// in your filterable Nova metric card class:

public function filterUserStatus($query, $status)
{
	return $query->where('status', $status);
}
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Marcel Pociot](https://github.com/mpociot)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

2822d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/863e91ca13b8c4031f202c0eee4f06b3a4352f92cf9cd397b03609b20247ed16?d=identicon)[beyondcode](/maintainers/beyondcode)

---

Top Contributors

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

---

Tags

laravelnovalaravelnova

### Embed Badge

![Health badge](/badges/beyondcode-nova-filterable-cards/health.svg)

```
[![Health](https://phpackages.com/badges/beyondcode-nova-filterable-cards/health.svg)](https://phpackages.com/packages/beyondcode-nova-filterable-cards)
```

###  Alternatives

[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2872.1M6](/packages/optimistdigital-nova-sortable)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2861.8M9](/packages/outl1ne-nova-sortable)[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[digital-creative/conditional-container

Provides an easy way to conditionally show and hide fields in your Nova resources.

116593.8k4](/packages/digital-creative-conditional-container)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

14720.0k](/packages/markwalet-nova-modal-response)

PHPackages © 2026

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