- What does the wotz/filament-belongs-to-many package do?
- It provides a Filament form field for managing Laravel belongsToMany relationships through a searchable, sortable multi-select UI. You can attach and detach related records inline, store pivot data, and customize the labels shown for related models. It is positioned as a lightweight alternative to Filament's default relationship component.
- How do I install wotz/filament-belongs-to-many in a Laravel app?
- Install it with composer require wotz/filament-belongs-to-many, then reference the field class in your Filament Resource form schema. Laravel package auto-discovery should register the service provider, so no manual provider entry is normally needed. Before requiring it, confirm the published vendor name matches the repository owner, since that mismatch is a supply-chain check worth clearing.
- Which Laravel and Filament versions does this package support?
- The package is described as built for Laravel and Filament v3 and later. Check the composer.json constraint directly before installing, because a caret range broad enough to admit an untested Filament major is a real upgrade risk. Also verify the last release date against Packagist and the repository tags rather than trusting index metadata.
- How is it different from Filament's built-in BelongsToMany field?
- Filament already ships a first-party BelongsToMany field that handles multi-select, checkbox lists, and tag-style input against a pivot table. This package's stated differentiators are a searchable, sortable UI, inline attach and detach, pivot data support, and custom labels. Ask for a concrete side-by-side of a pivot-attribute-editing scenario before adding a dependency, because the differentiation is not well documented.
- Can I edit pivot table data with this field?
- Yes, pivot data support is one of the package's advertised features. The critical detail is how it treats pivot columns that are not present in the form, since silently dropping them on save is the most common belongsToMany bug. Test that path explicitly with your own pivot schema, especially if it includes timestamps, soft deletes, or extra attributes.
- How does it handle attach and detach when saving a form?
- The save behavior is not stated in the package metadata, so inspect the source to see whether it uses sync or syncWithoutDetaching. That choice determines whether untouched pivot rows and their attributes survive an update. Add a feature test that saves a form and asserts the exact pivot table state afterward.
- Does it work with large relation sets and search?
- A searchable multi-select is the right shape for larger relation sets, but the metadata does not document backend search or pagination behavior. Verify how options are queried and whether the field loads all records up front, which matters once you reach hundreds or thousands of candidates. Benchmark it against your largest relationship before rollout.
- Can I customize the labels of related records?
- The package advertises support for custom labels, so you can control how related records appear in the select rather than relying on a single hard-coded attribute. The exact API is not covered in the metadata, so check the field's methods and README for the label callback or attribute name. Confirm it also applies to records already attached during form hydration.
- Does the package have tests and CI, and how should I test it?
- Test coverage and CI status cannot be verified from package metadata alone, and the project has no visible issue history or downstream consumers. Inspect the repository for tests covering attach, detach, empty state, and existing-record hydration before trusting it. If you adopt it, add your own feature tests around pivot persistence as a safety net.
- Is wotz/filament-belongs-to-many production-ready, and does it support Filament v4?
- Treat it as high adoption risk: zero stars, zero dependents, a single maintainer, and no stated support window or commitment to Filament v4. Filament has shipped breaking changes across majors, and a zero-adoption package has little pressure to track them, so you would own that upgrade path. The MIT license helps here, because it lets you vendor the field into your codebase and maintain it as a code sample rather than an unverified dependency.