{"id":21504436,"url":"https://github.com/dcasia/nova-pill-filter","last_synced_at":"2025-07-16T00:32:11.385Z","repository":{"id":36351075,"uuid":"223685885","full_name":"dcasia/nova-pill-filter","owner":"dcasia","description":"A Laravel Nova filter that renders into clickable pills.","archived":false,"fork":false,"pushed_at":"2023-10-28T08:34:19.000Z","size":958,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-31T08:03:35.646Z","etag":null,"topics":["filter","laravel","nova","nova4","pill","tags"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcasia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"milewski","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2019-11-24T03:14:17.000Z","updated_at":"2023-11-29T15:17:13.000Z","dependencies_parsed_at":"2023-10-13T03:11:25.406Z","dependency_job_id":null,"html_url":"https://github.com/dcasia/nova-pill-filter","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.2857142857142857,"last_synced_commit":"69fffaaabdfb41e92b5ccf7dda5fd7afbd18993b"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasia%2Fnova-pill-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasia%2Fnova-pill-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasia%2Fnova-pill-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasia%2Fnova-pill-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcasia","download_url":"https://codeload.github.com/dcasia/nova-pill-filter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226084430,"owners_count":17571155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filter","laravel","nova","nova4","pill","tags"],"created_at":"2024-11-23T19:00:09.926Z","updated_at":"2024-11-23T19:00:11.830Z","avatar_url":"https://github.com/dcasia.png","language":"Vue","funding_links":["https://github.com/sponsors/milewski"],"categories":[],"sub_categories":[],"readme":"# Nova Pill Filter\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/digital-creative/nova-pill-filter)](https://packagist.org/packages/digital-creative/nova-pill-filter)\n[![Total Downloads](https://img.shields.io/packagist/dt/digital-creative/nova-pill-filter)](https://packagist.org/packages/digital-creative/nova-pill-filter)\n[![License](https://img.shields.io/packagist/l/digital-creative/nova-pill-filter)](https://github.com/dcasia/nova-pill-filter/blob/main/LICENSE)\n\nA Laravel Nova filter that renders into clickable pills.\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/dcasia/nova-pill-filter/main/screenshots/dark-1.png\"\u003e\n  \u003cimg alt=\"PillFilter in Action\" src=\"https://raw.githubusercontent.com/dcasia/nova-pill-filter/main/screenshots/light-1.png\"\u003e\n\u003c/picture\u003e\n\n# Installation\n\nYou can install the package via composer:\n\n```shell\ncomposer require digital-creative/nova-pill-filter\n```\n\n## Basic Usage\n\nCreate a filter as usual and extend the `DigitalCreative\\PillFilter\\PillFilter` class\n\n```php\nuse DigitalCreative\\PillFilter\\PillFilter;\n\nclass MyFilter extends PillFilter {\n\n    public function apply(Request $request, $query, $values)\n    {\n        // $values will always be an array\n    }\n    \n    public function options(NovaRequest $request): array\n    {\n        return [\n           'Display Text 1' =\u003e 'value-1',\n           'Display Text 2' =\u003e 'value-2'\n        ];\n    }\n\n}\n```\n\nand use it as usual on the filters methods within your resource class:\n\n```php\nclass ExampleNovaResource extends Resource {\n\n    public function filters(NovaRequest $request): array\n    {\n        return [\n            MyFilter::make()\n        ];\n    }\n\n}\n```\n\nBy default, multiple items can be selected, you can restrict it to a single item at time by calling `-\u003esingle()`\n\n```php\nclass ExampleNovaResource extends Resource {\n\n    public function filters(NovaRequest $request): array\n    {\n        return [\n            MyFilter::make()-\u003esingle()\n        ];\n    }\n\n}\n```\n\nAdditionally, you can customize the mode the filter is displayed, by default it wraps to show all pills at once, however\nthere is also a `drag` and `stack` mode:\n\n| Drag Mode                                                                                                                                                                                                                                                                 | Stack Mode                                                                                                                                                                                                                                                                | Wrap Mode                                                                                                                                                                                                                                                               |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| \u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/dcasia/nova-pill-filter/main/screenshots/drag-dark.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/dcasia/nova-pill-filter/main/screenshots/drag-light.png\"\u003e\u003c/picture\u003e  | \u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/dcasia/nova-pill-filter/main/screenshots/stack-dark.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/dcasia/nova-pill-filter/main/screenshots/stack-light.png\"\u003e\u003c/picture\u003e | \u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/dcasia/nova-pill-filter/main/screenshots/wrap-dark.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/dcasia/nova-pill-filter/main/screenshots/wrap-light.png\"\u003e\u003c/picture\u003e |\n\n```php\nclass ExampleNovaResource extends Resource {\n\n    public function filters(NovaRequest $request): array\n    {\n        return [\n            MyFilter::make()-\u003edragMode(),\n            MyFilter::make()-\u003estackMode(),\n            MyFilter::make()-\u003ewrapMode(),\n        ];\n    }\n\n}\n```\n\n## ⭐️ Show Your Support\n\nPlease give a ⭐️ if this project helped you!\n\n### Other Packages You Might Like\n\n- [Nova Dashboard](https://github.com/dcasia/nova-dashboard) - The missing dashboard for Laravel Nova!\n- [Nova Welcome Card](https://github.com/dcasia/nova-welcome-card) - A configurable version of the `Help card` that comes with Nova.\n- [Icon Action Toolbar](https://github.com/dcasia/icon-action-toolbar) - Replaces the default boring action menu with an inline row of icon-based actions.\n- [Expandable Table Row](https://github.com/dcasia/expandable-table-row) - Provides an easy way to append extra data to each row of your resource tables.\n- [Collapsible Resource Manager](https://github.com/dcasia/collapsible-resource-manager) - Provides an easy way to order and group your resources on the sidebar.\n- [Resource Navigation Tab](https://github.com/dcasia/resource-navigation-tab) - Organize your resource fields into tabs.\n- [Resource Navigation Link](https://github.com/dcasia/resource-navigation-link) - Create links to internal or external resources.\n- [Nova Mega Filter](https://github.com/dcasia/nova-mega-filter) - Display all your filters in a card instead of a tiny dropdown!\n- [Nova Pill Filter](https://github.com/dcasia/nova-pill-filter) - A Laravel Nova filter that renders into clickable pills.\n- [Nova Slider Filter](https://github.com/dcasia/nova-slider-filter) - A Laravel Nova filter for picking range between a min/max value.\n- [Nova Range Input Filter](https://github.com/dcasia/nova-range-input-filter) - A Laravel Nova range input filter.\n- [Nova FilePond](https://github.com/dcasia/nova-filepond) - A Nova field for uploading File, Image and Video using Filepond.\n- [Custom Relationship Field](https://github.com/dcasia/custom-relationship-field) - Emulate HasMany relationship without having a real relationship set between resources.\n- [Column Toggler](https://github.com/dcasia/column-toggler) - A Laravel Nova package that allows you to hide/show columns in the index view.\n- [Batch Edit Toolbar](https://github.com/dcasia/batch-edit-toolbar) - Allows you to update a single column of a resource all at once directly from the index page.\n\n## License\n\nThe MIT License (MIT). Please see [License File](https://raw.githubusercontent.com/dcasia/nova-pill-filter/master/LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcasia%2Fnova-pill-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcasia%2Fnova-pill-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcasia%2Fnova-pill-filter/lists"}