PHPackages                             ziffmedia/nova-select-plus - 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. ziffmedia/nova-select-plus

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

ziffmedia/nova-select-plus
==========================

A Nova select field for simple and complex select inputs

v2.1.0(5mo ago)96608.8k↓39%37[10 issues](https://github.com/ziffmedia/nova-select-plus/issues)[7 PRs](https://github.com/ziffmedia/nova-select-plus/pulls)1MITPHPPHP ^8.0CI failing

Since Mar 3Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/ziffmedia/nova-select-plus)[ Packagist](https://packagist.org/packages/ziffmedia/nova-select-plus)[ RSS](/packages/ziffmedia-nova-select-plus/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (36)Used By (1)

Nova Select Plus
================

[](#nova-select-plus)

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

[](#installation)

```
composer require ziffmedia/nova-select-plus

```

Versions &amp; Compatibility
----------------------------

[](#versions--compatibility)

- Version `^1.0` supports Nova 2-3
- Version `^2.0` supports Nova 4 (with Vue 3, dark mode support, etc)
- Version `^2.1` supports Nova 5

Description &amp; Use Cases
---------------------------

[](#description--use-cases)

[![alt text](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/0-intro.gif "Intro Gif")](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/0-intro.gif)

This Nova component was built to satisfy the use cases just beyond Nova's built-in `` component. Here are some scenarios where you might want `SelectPlus` (which uses `vue-select`) over the simple `Select`:

#### Select For BelongsToMany and MorphsToMany On the Form Screen

[](#select-for-belongstomany-and-morphstomany-on-the-form-screen)

The default Nova experience for `BelongsToMany` and `MorphsToMany` is to have a separate UI screen for attaching/detaching and syncing relationships through a "Pivot" model. For simple relationships (relationships that do not have addition pivot values or the only value in the pivot table is there for ordering), it is benefitial to move this Selection to the Form workflow instead of a separate workflow.

#### Ajax For Options

[](#ajax-for-options)

For Select's that have between a handful to several 1000 options, it is more peformant to load the full list of options only on the screen that needs it: the Form screen.

There are 2 options for Ajax Options, the default is to load them all on the Form load. The second is to allow for full option searching (in this case you can write you own ajax search resolver).

### Reordering Simple Pivot/BelongsToMany Relations

[](#reordering-simple-pivotbelongstomany-relations)

Through `->reorderable()`, you can enable a `SelectPlus` field to be reorderable. This allows, at `BelongsToMany->sync()`time, to populate a pivot value useful for ordering relations.

Usage
-----

[](#usage)

```
use ZiffMedia\NovaSelectPlus\SelectPlus;
```

```
    // setup model like normal:
    public function statesLivedIn()
    {
        return $this->belongsToMany(State::class, 'state_user_lived_in')->withTimestamps();
    }

    // add Nova Resource Field
    SelectPlus::make('States Lived In', 'statesLivedIn', State::class),
```

### Options &amp; Examples

[](#options--examples)

#### `->label(string|closure $attribute)` Pick a different attribute to use as the label

[](#-labelstringclosure-attribute-pick-a-different-attribute-to-use-as-the-label)

`Default: 'name'`

```
SelectPlus::make('States Lived In', 'statesLivedIn', State::class)
  ->label('code')
```

If a closure is provided, it will be called and the value can be utilized. Additionally, the output may be HTML as the component will `v-html` the output on the frontend:

```
// Using php 7.4 short functions:
SelectPlus::make('States Visited', 'statesVisited', State::class)
    ->label(fn ($state) => $state->name . " ({$state->code})")
```

#### `->usingIndexLabel()` &amp; `->usingDetailLabel()`

[](#-usingindexlabel---usingdetaillabel)

Default is to produce a count of the number of items on the index and detail screen

[![alt text](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/1-default.png "Default Index")](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/1-default.png)

If a *string* name is provided, the name attribute is plucked and comma joined:

```
SelectPlus::make('States Lived In', 'statesLivedIn', State::class)
  ->usingIndexLabel('name'),
```

[![alt text](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/2-usingIndexLabel-string.png "string and comma separated")](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/2-usingIndexLabel-string.png)

If a closure is provided, it will be called, and the value will be utilized. If the value is a string, it will be placed:

```
SelectPlus::make('States Lived In', 'statesLivedIn', State::class)
  ->usingIndexLabel(fn($models) => $models->first()->name ?? ''),
```

[![alt text](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/3-usingIndexLabel-callback.png "return just the first name")](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/3-usingIndexLabel-callback.png)

If an array is returned, the Index and Detail screens will produce a `` or `` list:

```
SelectPlus::make('States Lived In', 'statesLivedIn', State::class)
  ->usingIndexLabel(fn($models) => $models->pluck('name')),
```

[![alt text](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/4-usingDetailLabel-array.png "array of values")](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/4-usingDetailLabel-array.png)

#### `->reorderable(string $pivotOrderAttribute)` - Ability to reorder multiple selects

[](#-reorderablestring-pivotorderattribute---ability-to-reorder-multiple-selects)

```
    // assuming in the User model:
    public function statesVisited()
    {
        return $this->belongsToMany(State::class, 'state_user_visited')
            ->withPivot('order')
            ->orderBy('order')
            ->withTimestamps();
    }

    // inside the Nova resource:
    SelectPlus::make('States Lived In', 'statesLivedIn', State::class)
        ->reorderable('order'),
```

[![alt text](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/5-reorderable.gif "reorder a list")](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/5-reorderable.gif)

#### `->optionsQuery(closure)` - Ability to apply changes to options query object

[](#-optionsqueryclosure---ability-to-apply-changes-to-options-query-object)

```
    // inside the Nova resource (exclude all states that start with C)
    SelectPlus::make('States Lived In', 'statesLivedIn', State::class)
        ->optionsQuery(function (Builder $query) {
            $query->where('name', 'NOT LIKE', 'C%');
        })
```

- Note: this will apply before any `ajaxSearchable()` functionality, it will not replace it but be applied along with `ajaxSearchable()` if it exists

#### `->ajaxSearchable(string|closure|true)` Ajax search for values

[](#-ajaxsearchablestringclosuretrue-ajax-search-for-values)

Given a string, models will be search the resources via the provided attribute using WHERE LIKE. Given a callback, returning a Collection will populate the dropdown:

```
    SelectPlus::make('States Visited', 'statesVisited', State::class)
        ->ajaxSearchable(function ($search) {
            return StateModel::where('name', 'LIKE', "%{$search}%")->limit(5);
        })
```

[![alt text](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/6-ajaxSearchable.gif "reorder a list")](https://github.com/ziffmedia/nova-select-plus/raw/master/docs/6-ajaxSearchable.gif)

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance71

Regular maintenance activity

Popularity53

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 80.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 ~90 days

Recently: every ~186 days

Total

25

Last Release

154d ago

Major Versions

v1.0.11 → v2.0.02022-08-29

PHP version history (3 changes)v1.0.0PHP &gt;=7.1.0

v2.0.0PHP ^7.3|^8.0

v2.1.0-beta.1PHP ^8.0

### Community

Maintainers

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

![](https://avatars.githubusercontent.com/u/107836?v=4)[Josh Butts](/maintainers/jimbojsb)[@jimbojsb](https://github.com/jimbojsb)

---

Top Contributors

[![ralphschindler](https://avatars.githubusercontent.com/u/76674?v=4)](https://github.com/ralphschindler "ralphschindler (53 commits)")[![justindantzer](https://avatars.githubusercontent.com/u/2125752?v=4)](https://github.com/justindantzer "justindantzer (3 commits)")[![eugenefvdm](https://avatars.githubusercontent.com/u/1836436?v=4)](https://github.com/eugenefvdm "eugenefvdm (2 commits)")[![victorlap](https://avatars.githubusercontent.com/u/1645632?v=4)](https://github.com/victorlap "victorlap (2 commits)")[![pecuchet](https://avatars.githubusercontent.com/u/10818207?v=4)](https://github.com/pecuchet "pecuchet (1 commits)")[![socramjunio2](https://avatars.githubusercontent.com/u/21258161?v=4)](https://github.com/socramjunio2 "socramjunio2 (1 commits)")[![NickBelhomme](https://avatars.githubusercontent.com/u/312003?v=4)](https://github.com/NickBelhomme "NickBelhomme (1 commits)")[![miagg](https://avatars.githubusercontent.com/u/6439071?v=4)](https://github.com/miagg "miagg (1 commits)")[![mstaack](https://avatars.githubusercontent.com/u/10169509?v=4)](https://github.com/mstaack "mstaack (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

ajaxlaravelmultiselectnovaselectvuevue-selectvuedraggablelaravelajaxselectnovavue-select

### Embed Badge

![Health badge](/badges/ziffmedia-nova-select-plus/health.svg)

```
[![Health](https://phpackages.com/badges/ziffmedia-nova-select-plus/health.svg)](https://phpackages.com/packages/ziffmedia-nova-select-plus)
```

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3453.7M8](/packages/optimistdigital-nova-multiselect-field)[optimistdigital/nova-sortable

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

2852.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.

2862.1M9](/packages/outl1ne-nova-sortable)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[advoor/nova-editor-js

A Laravel Nova field bringing EditorJs magic to Nova.

92219.3k3](/packages/advoor-nova-editor-js)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

58249.9k](/packages/sbine-route-viewer)

PHPackages © 2026

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