PHPackages                             dillingham/nova-ajax-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. dillingham/nova-ajax-select

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

dillingham/nova-ajax-select
===========================

Nova Ajax Select

1.0.4(5y ago)861.4M↓43.3%20[11 issues](https://github.com/dillingham/nova-ajax-select/issues)[3 PRs](https://github.com/dillingham/nova-ajax-select/pulls)2MITVuePHP &gt;=7.1.0

Since Feb 10Pushed 2y ago2 watchersCompare

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

READMEChangelog (8)DependenciesVersions (10)Used By (2)

Nova Ajax Select
================

[](#nova-ajax-select)

[![Latest Version on Github](https://camo.githubusercontent.com/4bde8413d1a099ee1fbdbb00d40a549747ef318d903fb9fb79b1dbc7ae977354/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f64696c6c696e6768616d2f6e6f76612d616a61782d73656c6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dillingham/nova-ajax-select)[![Total Downloads](https://camo.githubusercontent.com/dabdff060234199e6e34d168d6aec36c102beb624b6d9285eb590686a8f3eef3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64696c6c696e6768616d2f6e6f76612d616a61782d73656c6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dillingham/nova-ajax-select) [![Twitter Follow](https://camo.githubusercontent.com/4d611bda2f6e8730161339d887cbe17afe7f160bfde2eeb1baaf7cc40dd65071/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f696d5f627269616e5f643f636f6c6f723d253233316461316631266c6162656c3d54776974746572266c6f676f3d253233316461316631266c6f676f436f6c6f723d253233316461316631267374796c653d666c61742d737175617265)](https://twitter.com/im_brian_d)

Ajax populated select fields based on the values of other fields and when they change.

[![nova-ajax-select](https://user-images.githubusercontent.com/29180903/52602810-15c53900-2e32-11e9-9ade-492bfe80b234.gif)](https://user-images.githubusercontent.com/29180903/52602810-15c53900-2e32-11e9-9ade-492bfe80b234.gif)

### Install

[](#install)

```
composer require dillingham/nova-ajax-select

```

### Usage

[](#usage)

Specify a request url &amp; optionally the `parent($attribute)` to watch &amp; trigger the ajax select:

```
use NovaAjaxSelect\AjaxSelect;
```

```
BelongsTo::make('Company'),

AjaxSelect::make('User')
    ->get('/api/company/{company}/users')
    ->parent('company'),
```

Add the field for index &amp; detail views display. AjaxSelect is for forms only

```
BelongsTo::make('User')->exceptOnForms(),
```

### Request Url:

[](#request-url)

In the above example, we say `company` is the parent.

The `{company}` url parameter will equal the selected `Company` field value.

### Response Format:

[](#response-format)

The select field expects a `value` &amp; `display`. Map your results like so:

```
Route::get('api/company/{company}/users', function($company_id) {

    $company = \App\Company::find($company_id);

    return $company->users->map(function($user) {
        return [ 'value' => $user->id, 'display' => $user->name ];
    });
})->middleware(['nova']);
```

### Make children depend on other children

[](#make-children-depend-on-other-children)

`City` makes a request based on `State`, which makes a request based on `Country`:

```
Select::make('Country')
    ->options([]),

AjaxSelect::make('State')
    ->get('/api/country/{country}/states')
    ->parent('country'),

AjaxSelect::make('City')
    ->get('/api/state/{state}/cities')
    ->parent('state'),
```

### Make multiple children depend on one parent

[](#make-multiple-children-depend-on-one-parent)

`File` &amp; `Comment` will both make a request based on `Project`

```
BelongsTo::make('Project'),

AjaxSelect::make('File')
    ->get('/{project}/files')
    ->parent('project'),

AjaxSelect::make('Comment')
    ->get('/{project}/comments')
    ->parent('project'),
```

---

Author
======

[](#author)

Hi 👋, Im Brian Dillingham, creator of this Nova package [and others](https://novapackages.com/collaborators/dillingham)

Hope you find it useful. Feel free to reach out with feedback.

Follow me on twitter: [@im\_brian\_d](https://twitter.com/im_brian_d)

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity54

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~80 days

Recently: every ~141 days

Total

8

Last Release

2136d ago

Major Versions

0.0.3 → 1.02019-02-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29180903?v=4)[Brian](/maintainers/dillingham)[@dillingham](https://github.com/dillingham)

---

Top Contributors

[![dillingham](https://avatars.githubusercontent.com/u/29180903?v=4)](https://github.com/dillingham "dillingham (6 commits)")

---

Tags

laravellaravel-novalaravelnova

### Embed Badge

![Health badge](/badges/dillingham-nova-ajax-select/health.svg)

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

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

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

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

52178.7k1](/packages/inspheric-nova-defaultable)[murdercode/nova4-tinymce-editor

Boost your Laravel Nova with the TinyMCE editor.

17186.3k1](/packages/murdercode-nova4-tinymce-editor)[datomatic/nova-detached-actions

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

11273.0k](/packages/datomatic-nova-detached-actions)[wemersonrv/input-mask

A Laravel Nova custom field text with masks on input

1198.4k](/packages/wemersonrv-input-mask)

PHPackages © 2026

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