PHPackages                             liking/select2-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. liking/select2-filter

ActiveLibrary

liking/select2-filter
=====================

Nova Select2 Filter

1.0.0(7y ago)0580MITVuePHP &gt;=7.1.0

Since Apr 20Pushed 6y ago1 watchersCompare

[ Source](https://github.com/liking/select2-filter)[ Packagist](https://packagist.org/packages/liking/select2-filter)[ RSS](/packages/liking-select2-filter/feed)WikiDiscussions master Synced 2mo ago

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

Nova Select2 Filter
-------------------

[](#nova-select2-filter)

[![Latest Version on Github](https://camo.githubusercontent.com/dff2e6ae1400029108e66b3171a890eb7e283d99793ae1cb3ba0d314336362ee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6c696b696e672f73656c656374322d66696c7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/liking/select2-filter)[![Total Downloads](https://camo.githubusercontent.com/e597efcb595d55002de3e728e71175566e9ace5a9e8d35f8acd26d96c9221ab9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c696b696e672f73656c656374322d66696c7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/liking/select2-filter)

Nova package for rendering filter using select2 ajax.

### Installation

[](#installation)

```
composer require liking/select2-filter
```

### Usage

[](#usage)

##### Backend

[](#backend)

```
use Liking\Select2Filter\Select2Filter;

class CustomFilter extends Select2Filter
{
    /**
     * The field used to display as option's label.
     * If not config, use default value is `title`
     *
     * @var string
     */
    public $filterTitle = 'title';

    /**
     * The field used to represent option's value.
     * If not config, use default value is `id`
     *
     * @var string
     */
    public $filterId = 'id';

    /**
     * Name of Nova Resource to search
     * If not config, user current Resource
     *
     * @var string
     */
    public $filterResource = '';

    ....
```

##### Template

[](#template)

- HTML

```

        {{ filter.name }}

```

- Script handle event

```
methods: {
    handleChange(event) {
        this.$store.commit(`${this.resourceName}/updateFilterState`, {
            filterClass: this.filterKey,
            value: event,
        })
        this.$emit('change')
    },
},
```

Difference with original: *value: event* vs *value: event.target.value*

This difference because in default nova filter resource, options is a predefined array, so it don't need labels to display in the option. When used Select2, we need boot id and label to show in option

---

### Backend events

[](#backend-events)

Note that *$value* not same as default Nova filter value, *$value* is an array contain *value* and *label*

```
public function apply(Request $request, $query, $value)
    {
        $searchValue = Arr::get($value, 'value');

        if ($searchValue) {
            $query->where('id', $searchValue);
        }
        return $query;
    }
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

2582d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9f9a19e2f43f20ece5c3f7f21645cc964ab0bb110858cbfc62ef4a78a2bbe3dd?d=identicon)[liking](/maintainers/liking)

---

Tags

laravelnovaselect2 filter

### Embed Badge

![Health badge](/badges/liking-select2-filter/health.svg)

```
[![Health](https://phpackages.com/badges/liking-select2-filter/health.svg)](https://phpackages.com/packages/liking-select2-filter)
```

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[coreproc/nova-notification-feed

A Laravel Nova package that adds a notification feed in your Nova app.

10149.1k](/packages/coreproc-nova-notification-feed)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

51174.8k1](/packages/inspheric-nova-defaultable)[cybercog/laravel-nova-ban

A Laravel Nova banning functionality for your application.

40199.8k](/packages/cybercog-laravel-nova-ban)[insenseanalytics/nova-server-monitor

A Laravel Nova tool for Spatie's Server Monitor library.

6546.9k](/packages/insenseanalytics-nova-server-monitor)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11229.2k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

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