PHPackages                             metasync-site/nova-has-many-searchable - 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. metasync-site/nova-has-many-searchable

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

metasync-site/nova-has-many-searchable
======================================

A Laravel Nova field for searchable has-many relationships

v1.0.5(1y ago)12.3k↓50%MITPHPPHP &gt;=8.2

Since Jan 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/metasyncSite/nova-has-many-searchable)[ Packagist](https://packagist.org/packages/metasync-site/nova-has-many-searchable)[ RSS](/packages/metasync-site-nova-has-many-searchable/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Nova HasMany Searchable Field
=====================================

[](#laravel-nova-hasmany-searchable-field)

A Laravel Nova field that provides a searchable interface for has-many relationships with the ability to create new related resources.

[![screenshot of the search relations tool](./screenshot.png)](./screenshot.png)

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

[](#requirements)

- PHP 8.2+
- Laravel 11.x | 12.x
- Laravel Nova 4.x | 5.x

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

[](#installation)

You can install the package via composer:

```
composer require metasync-site/nova-has-many-searchable
```

Usage
-----

[](#usage)

```
use MetasyncSite\NovaHasManySearchable\HasManySearchable;

public function fields(NovaRequest $request)
{
    return [
        HasManySearchable::make('Coupons')
            ->relationshipConfig(
                resourceClass: CouponsResource::class,
                foreignKey: 'GoodsDataId',
                displayCallback: function ($coupon) {
                    return "{$coupon?->Name} (Type: {$coupon->Type})";
                }
            )
            ->withCreateButton(true, 'Create New Coupon'),
    ];
}
```

Features
--------

[](#features)

- 🔍 Searchable interface for has-many relationships
- ✨ Custom display formatting
- ➕ Optional "Create New" button with modal
- 🎨 Dark mode support
- 🎯 Type-safe implementation

Configuration
-------------

[](#configuration)

### Display Callback

[](#display-callback)

You can customize how each option is displayed using the `displayCallback`:

```
HasManySearchable::make('Coupons')
    ->relationshipConfig(
        resourceClass: CouponsResource::class,
        foreignKey: 'GoodsDataId',
        displayCallback: fn($model) => "{$model->name} ({$model->code})"
    )
```

### Create Button

[](#create-button)

Enable the create button with an optional custom label:

```
HasManySearchable::make('Coupons')
    ->withCreateButton(true, 'Add New Coupon')
```

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

[](#security-vulnerabilities)

If you discover any security vulnerabilities, please email

Credits
-------

[](#credits)

- [Metasync](https://github.com/metasyncSite)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance47

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~16 days

Total

6

Last Release

399d ago

PHP version history (2 changes)v1.0.0PHP ^8.2

v1.0.3PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d463f04fe31693ccfacd94a07abaae0d45a680b0895afc579138b83e5a13364?d=identicon)[metasyncSite](/maintainers/metasyncSite)

---

Top Contributors

[![gerasart](https://avatars.githubusercontent.com/u/8726693?v=4)](https://github.com/gerasart "gerasart (10 commits)")[![metasyncSite](https://avatars.githubusercontent.com/u/157399850?v=4)](https://github.com/metasyncSite "metasyncSite (4 commits)")

---

Tags

laravelsearchablefieldnovahas-many

### Embed Badge

![Health badge](/badges/metasync-site-nova-has-many-searchable/health.svg)

```
[![Health](https://phpackages.com/badges/metasync-site-nova-has-many-searchable/health.svg)](https://phpackages.com/packages/metasync-site-nova-has-many-searchable)
```

###  Alternatives

[inspheric/nova-url-field

A Laravel Nova URL field.

1031.3M1](/packages/inspheric-nova-url-field)[alexwenzel/nova-dependency-container

A Laravel Nova 4 form container for grouping fields that depend on other field values.

461.0M2](/packages/alexwenzel-nova-dependency-container)[outl1ne/nova-simple-repeatable

A Laravel Nova simple repeatable rows field.

74356.3k](/packages/outl1ne-nova-simple-repeatable)[simplesquid/nova-enum-field

A Laravel Nova field to add enums to resources.

52391.9k2](/packages/simplesquid-nova-enum-field)[sietse85/nova-button

(Nova 4+) A Laravel Nova package for adding buttons to your resources.

37347.3k](/packages/sietse85-nova-button)[optimistdigital/nova-notes-field

This Laravel Nova package adds a notes field to Nova's arsenal of fields.

52139.5k](/packages/optimistdigital-nova-notes-field)

PHPackages © 2026

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