benjacho/belongs-to-many-field
Benjacho's BelongsToMany field for Laravel Nova adds a searchable modal for attaching and detaching related models, supports inline creation, and simplifies managing many-to-many relationships in Nova resources.
belongsToMany relationships, collapsing Nova's native index → attach → detach flow into a single searchable form control. A PM can use it to ship internal admin workflows—tagging, categorisation, role assignment, catalog curation—in hours instead of funding custom Vue field work or a bespoke pivot-CRUD resource.fields() method, it de-risks roadmap sequencing: operations teams get usable tooling now while the team validates processes before committing to customer-facing investment.singleSelect()/displayAsBadges() reduce engineering interrupts for routine relationship maintenance. If a PM is tracking internal ticket volume per admin workflow, this is a measurable lever.Consider it when:
belongsToMany relation admins must maintain. Fit is binary and stack-gated—no Nova, no use case.3.0.1-beta line, 156 stars, no dependents) with MIT fork rights as the contingency.options() for small fixed or tenant-scoped sets, label() + searchable() for large dynamic tables, pivot fields declared via the model's withPivot, and inline creation that can be policy- and validation-tested.Look elsewhere when:
For executives: This is a small, MIT-licensed Nova add-on that accelerates internal admin tooling for many-to-many data management and cuts engineering effort on routine relationship maintenance. It is a tactical productivity lever, not a platform bet—approve it for internal Nova admin surfaces only. The licence cost is negligible; the real cost is a bounded maintenance line of roughly 2–5 engineer-days per year, concentrated around Nova/Laravel upgrades. Ask for: a compatibility spike on production versions, an exact Composer pin, a named internal owner, a one-line-per-resource rollback to Nova's native field, and a documented MIT fork procedure. Expect near-zero upstream churn and near-zero upstream fixes—the least favourable combination—so treat the fork right, not the roadmap, as the safety net.
For engineering: It provides a ready-made Nova representation for belongsToMany fields, eliminating custom Vue work for standard attach/detach flows. Integration is a composer require plus BelongsToManyField::make('Tags', 'tags', Tag::class) in fields(); no provider registration, no migrations, no model opinions, no domain coupling—structurally additive and trivially removable. Before committing, run a bounded spike on exact production versions and accept only on evidence: field renders; assets publish and cache-bust correctly through the deploy pipeline; search returns correct results, queries server-side, and respects policies; pivot writes persist; inline create honours validation and authorisation. Capture query counts and form-render time at 10k+ related records. Pin the constraint exactly, make the options() vs. searchable() choice explicit per resource (wrong choice is where operational risk concentrates), use hideFromIndex() where list rendering is unnecessary, and add a standing line to the Nova upgrade runbook requiring re-validation and asset re-publish. Pilot one low-risk resource in staging with non-technical operators, measure time-to-complete against the native flow, then roll out in batches with rollback documented in each resource.
Known failure modes to own: Nova upgrades silently breaking the Vue component or asset build; stale published assets causing environment-divergent UI; picker truncation or mis-search on large datasets persisting incorrect associations; inline creation bypassing policies or validation; upstream abandonment leaving no security patches.
How can I help you explore Laravel packages today?