PHPackages                             codicastudio/multi-select - 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. codicastudio/multi-select

ActiveLibrary

codicastudio/multi-select
=========================

1.0.0(5y ago)00MITVuePHP ^7.4 || ^8.0CI failing

Since Sep 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/codicastudio/multi-select)[ Packagist](https://packagist.org/packages/codicastudio/multi-select)[ Docs](https://github.com/codicastudio/adminmultiselect)[ RSS](/packages/codicastudio-multi-select/feed)WikiDiscussions master Synced 1mo ago

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

Nova Multiselect
================

[](#nova-multiselect)

This [Laravel Nova](https://nova.laravel.com) package adds a multiselect to Nova's arsenal of fields.'

Requirements
------------

[](#requirements)

- Laravel Nova ^2.0.11

For Nova version earlier than 2.0.11 please use `nova-multiselect-field` version `1.1.6` or earlier.

This restriction is due to `Nova::translatable()` method being added in 2.0.11, which allows this package to be localized.

Features
--------

[](#features)

- Multiselect with search
- Single select with search
- Reordering functionality with drag &amp; drop
- Dependency on other Multiselect instances

Screenshots
-----------

[](#screenshots)

[![Detail View](docs/detail.png)](docs/detail.png)

[![Form View](docs/form.png)](docs/form.png)

[![Index View](docs/index.png)](docs/index.png)

[![Reorder GIF](docs/reorder.gif)](docs/reorder.gif)

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

[](#installation)

Install the package in a Laravel Nova project via Composer:

```
composer require optimistdigital/nova-multiselect-field
```

Usage
-----

[](#usage)

The field is used similarly to Nova's native Select field. The field type in the database should be text-based (ie `string`, `text` or `varchar`), selected values are stored as a stringified JSON array.

```
use OptimistDigital\MultiselectField\Multiselect;

public function fields(Request $request)
{
    return [
      Multiselect
        ::make('Favourite football teams', 'football_teams')
        ->options([
          'liverpool' => 'Liverpool FC',
          'tottenham' => 'Tottenham Hotspur',
          'bvb' => 'Borussia Dortmund',
          'bayern' => 'FC Bayern Munich',
          'barcelona' => 'FC Barcelona',
          'juventus' => 'Juventus FC',
          'psg' => 'Paris Saint-Germain FC',
        ])

        // Optional:
        ->placeholder('Choose football teams') // Placeholder text
        ->max(4) // Maximum number of items the user can choose
        ->saveAsJSON() // Saves value as JSON if the database column is of JSON type
        ->optionsLimit(5) // How many items to display at once
        ->reorderable() // Allows reordering functionality
        ->singleSelect() // If you want a searchable single select field
    ];
}
```

### Option groups

[](#option-groups)

Option groups are supported. Their syntax is the same as [Laravel's option group syntax](https://nova.laravel.com/docs/2.0/resources/fields.html#select-field).

In this example (from Nova docs), all values are grouped by the `group` key:

```
->options([
    'MS' => ['label' => 'Small', 'group' => 'Men Sizes'],
    'MM' => ['label' => 'Medium', 'group' => 'Men Sizes'],
    'WS' => ['label' => 'Small', 'group' => 'Women Sizes'],
    'WM' => ['label' => 'Medium', 'group' => 'Women Sizes'],
])
```

### Dependencies

[](#dependencies)

You can make a Multiselect depend on another by using `dependsOn`. This also requires specifying `->dependsOnOptions()`. The value from the `dependsOn` Multiselect has to be the key to the options and the value must be a key-value dictionary of options as usual.

Usage:

```
Multiselect::make('Country', 'country')
    ->options([
        'IT' => 'Italy',
        'SG' => 'Singapore',
    ]),

Multiselect::make('Language', 'language')
    ->dependsOn('country')
    ->dependsOnOptions([
        'IT' => [
            'it' => 'Italian',
        ],
        'SG' => [
            'en' => 'English',
            'ms' => 'Malay',
            'zh' => 'Chinese',
        ]
    ]),

    // Optionally define max number of values
    ->dependsOnMax([
        'IT' => 1,
        'SG' => 3,
    ])

```

Options
-------

[](#options)

Possible options you can pass to the field using the option name as a function, ie `->placeholder('Choose peanuts')`.

Optiontypedefaultdescription`options`Array|callable\[\]Options in an array as key-value pairs (`['id' => 'value']`).`placeholder`StringField nameThe placeholder string for the input.`max`NumberInfiniteThe maximum number of options a user can select.`groupSelect`BooleanfalseFor use with option groups - allows the user to select whole groups at once`singleSelect`BooleanfalseMakes the field act as a single select which also means the saved value will not be an array.`saveAsJSON`BooleanfalseWhen you have a SQL JSON column, you can force the field to save the values as JSON. By default, values are saved as a stringified array.`optionsLimit`Number1000The maximum number of options displayed at once. Other options are still accessible through searching.`nullable`BooleanfalseIf the field is nullable an empty select will result in `null` else an empty array (`[]`) is stored.`reorderable`BooleanfalseEnables (or disables) the reordering functionality of the multiselect field.`dependsOn`StringnullDetermines which Multiselect this field depends on.`dependsOnOptions`ArraynullDetermines the options for `dependsOn`. See example above on how to format it correctly.`resolveForPageResponseUsing`CallablenullOnly for use in conjunction with [Page Manager](https://github.com/optimistdigital/nova-page-manager). Allows you to format the value before it is returned through the API.Localization
------------

[](#localization)

The translations file can be published by using the following publish command:

```
php artisan vendor:publish --provider="OptimistDigital\MultiselectField\FieldServiceProvider" --tag="translations"
```

You can then edit the strings to your liking.

Overwriting the detail field
----------------------------

[](#overwriting-the-detail-field)

You can overwrite the detail view value component to customize it as you see fit.

Create a new component for `NovaMultiselectDetailFieldValue` and register it in your `app.js`. The component receives two props: `field` and `values`. The `values` prop is an array of selected labels.

```
// in NovaMultiselectDetailFieldValue.vue

        {{ value }}

  —

export default {
  props: ['field', 'values'],
};

```

```
// in app.js

import NovaMultiselectDetailFieldValue from './NovaMultiselectDetailFieldValue';

Nova.booting((Vue, router, store) => {
  Vue.component('nova-multiselect-detail-field-value', NovaMultiselectDetailFieldValue);
});
```

Credits
-------

[](#credits)

- [shentao/vue-multiselect](https://vue-multiselect.js.org)

License
-------

[](#license)

This project is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

2063d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a33b354bea681b74be49f37bbe9f3c4f145dbefe0f2b5cbb705b0731bf13fd3?d=identicon)[codicastudio](/maintainers/codicastudio)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/codicastudio-multi-select/health.svg)

```
[![Health](https://phpackages.com/badges/codicastudio-multi-select/health.svg)](https://phpackages.com/packages/codicastudio-multi-select)
```

###  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)[laravel/nova-log-viewer

A Laravel Nova tool for viewing your application logs.

136301.3k1](/packages/laravel-nova-log-viewer)[stepanenko3/nova-command-runner

Laravel Nova tool for running Artisan and bash(shell) commands.

36983.0k](/packages/stepanenko3-nova-command-runner)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[dniccum/nova-documentation

A Laravel Nova tool that allows you to add markdown-based documentation to your administrator's dashboard.

37116.4k](/packages/dniccum-nova-documentation)

PHPackages © 2026

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