PHPackages                             gabrielesbaiz/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. gabrielesbaiz/nova-ajax-select

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

gabrielesbaiz/nova-ajax-select
==============================

Ajax select / child select package for Laravel Nova.

1.0.0(1y ago)02.4k↑850%MITPHPPHP ^8.0CI passing

Since Mar 3Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/gabrielesbaiz/nova-ajax-select)[ Packagist](https://packagist.org/packages/gabrielesbaiz/nova-ajax-select)[ Docs](https://github.com/gabrielesbaiz/nova-ajax-select)[ GitHub Sponsors]()[ RSS](/packages/gabrielesbaiz-nova-ajax-select/feed)WikiDiscussions main Synced 1mo ago

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

NovaAjaxSelect
==============

[](#novaajaxselect)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e60fb2a0106cc3664d432a348c8c554d45d49b0a40ce537a3df36b75e548fce8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6761627269656c65736261697a2f6e6f76612d616a61782d73656c6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gabrielesbaiz/nova-ajax-select)[![Total Downloads](https://camo.githubusercontent.com/c0727baffd199bcb483afb2620cd8431df767b3dde56175705adc15e8d366cee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6761627269656c65736261697a2f6e6f76612d616a61782d73656c6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gabrielesbaiz/nova-ajax-select)

Ajax select / child select package for Laravel Nova.

Original code from [alexwenzel/nova-ajax-select](https://github.com/alexwenzel/nova-ajax-select)

Features
--------

[](#features)

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

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

[](#installation)

You can install the package via composer:

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

Usage
-----

[](#usage)

```
$novaAjaxSelect = new Gabrielesbaiz\NovaAjaxSelect();
echo $novaAjaxSelect->echoPhrase('Hello, Gabrielesbaiz!');
```

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

```
use Gabrielesbaiz\NovaAjaxSelect\NovaAjaxSelect;;
```

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

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

Add the field for index &amp; detail views display. NovaAjaxSelect 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([]),

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

NovaAjaxSelect::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'),

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

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

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [alexwenzel](https://github.com/alexwenzel)
- [dillingham](https://github.com/dillingham)
- [Gabriele Sbaiz](https://github.com/gabrielesbaiz)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance47

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

442d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/97040fb60637d4b81897347524bc9343ffa6b978d4b19c0c28ea0823e2a1752b?d=identicon)[gabrielesbaiz](/maintainers/gabrielesbaiz)

---

Top Contributors

[![gabrielesbaiz](https://avatars.githubusercontent.com/u/22818698?v=4)](https://github.com/gabrielesbaiz "gabrielesbaiz (3 commits)")

---

Tags

laravelGabriele Sbaiznova-ajax-select

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

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