marshmallow / nova-mega-filter
Allows you to control the columns and filters shown on your nova resources.
Package info
github.com/marshmallow-packages/nova-mega-filter
Language:Vue
pkg:composer/marshmallow/nova-mega-filter
Requires
- php: ^8.0
- laravel/nova: ^4.0|^5.0
- nova-kit/nova-packages-tool: ^1.3|^v2.0
This package is auto-updated.
Last update: 2026-06-19 08:15:17 UTC
README
Important
This package was originally forked from digital-creative/nova-mega-filter. Since we were making many opinionated changes, we decided to continue development in our own version rather than submitting pull requests that might not benefit all users of the original package. You’re welcome to use this package—we’re actively maintaining it. If you encounter any issues, please don’t hesitate to reach out.
Nova Mega Filter
Display all your filters in a card instead of a tiny dropdown!
Requirements
- PHP
^8.0 - Laravel Nova
^4.0 | ^5.0
Installation
You can install the package via composer:
composer require marshmallow/nova-mega-filter
The service provider is registered automatically through Laravel package discovery, and the card's assets are registered with Nova on boot — there is nothing else to publish.
Basic Usage
Add the MegaFilterTrait to your Nova resource (or lens) and wrap the filters
you want to display in the card with MegaFilter::make():
use Marshmallow\MegaFilter\MegaFilter; use Marshmallow\MegaFilter\MegaFilterTrait; class ExampleNovaResource extends Resource { use MegaFilterTrait; public function filters(NovaRequest $request): array { return [ MegaFilter::make([ DateOfBirthFilter::make(), UserTypeFilter::make(), ]), ]; } }
And you are done!
You can also add other filters alongside your Mega Filter, they will be rendered as usual:
use Marshmallow\MegaFilter\MegaFilter; use Marshmallow\MegaFilter\MegaFilterTrait; class ExampleNovaResource extends Resource { use MegaFilterTrait; public function filters(NovaRequest $request): array { return [ MegaFilter::make([ ... ]), // These will be rendered as normal on the usual tiny filter dropdown DateOfBirthFilter::make(), UserTypeFilter::make(), ]; } }
You can also set how many columns you want to display your filters:
public function filters(NovaRequest $request): array { return [ MegaFilter::make([ ... ])->columns(3), ]; }
By default, the filter section is collapsed. If you want it to be open or expanded initially, you can do:
public function filters(NovaRequest $request): array { return [ MegaFilter::make([ ... ])->open(), ]; }
Filter Width Control
You can control the width of individual filters using Tailwind CSS width classes. This allows you to create custom layouts where some filters take up more or less space:
public function filters(NovaRequest $request): array { return [ MegaFilter::make([ (new Filter001)->withMeta(['width' => 'w-1/3']), (new Filter002)->withMeta(['width' => 'w-2/3']), (new Filter003), // Uses default width (new Filter004)->withMeta(['width' => 'w-1/2']), (new Filter005)->withMeta(['width' => 'w-1/2']), ]), ]; }
Available width classes include:
w-full- Full width (default)w-1/2- Half width (50%)w-1/3- One third width (33.33%)w-2/3- Two thirds width (66.67%)w-1/4- Quarter width (25%)w-3/4- Three quarters width (75%)w-1/6,w-2/6,w-3/6,w-4/6,w-5/6- Sixth-based widthsw-1/12,w-2/12,w-3/12, etc. - Twelfth-based widths- Any other Tailwind width class
Note: At the moment this package only works with a single Mega Filter per resource, adding multiple on the same resource may result in unexpected behavior.
API Reference
The MegaFilter instance returned by MegaFilter::make() exposes the following
fluent methods:
| Method | Description |
|---|---|
columns(int $columns) |
Number of columns to lay the filters out in. |
open(bool $open = true) |
Render the filter card expanded instead of collapsed. |
withMeta(array $meta) |
Pass additional meta data to the card (e.g. ['width' => 'w-1/2'] on an individual filter). |
Credits
This package was originally forked from digital-creative/nova-mega-filter.
Security
If you discover any security related issues, please email security@marshmallow.dev instead of using the issue tracker.
License
The MIT License (MIT). Please see the License File for more information.