- How do I install cocosmos/filament-quick-add-select in a Laravel app?
- Run composer require cocosmos/filament-quick-add-select. Laravel package auto-discovery registers the service provider, so there is nothing to publish and no migration to run. The package requires PHP 8.2+, Laravel 11, 12 or 13, Filament 4 or 5, and Livewire. It is a purely additive UX layer, so removing it later needs no data cleanup.
- How do I add the "+ Add" option to a Filament relationship Select?
- Chain ->quickAdd() onto any Select that already uses ->relationship() and ->searchable(). For example, Select::make('profession_id')->relationship('profession', 'name')->searchable()->quickAdd(). When a search returns no match, users see a "+ Add 'term'" option that creates the record and auto-selects it.
- Does Filament Quick Add Select work with multiple selects?
- Yes. Add ->multiple() to the Select before calling ->quickAdd(), and the newly created record is created and selected alongside the existing choices. The package supports single and multiple relationship selects with the same API. No extra configuration is required for the multiple variant.
- Does this package support Filament 3 or older Laravel versions?
- No. The package targets Filament 4 and 5 on PHP 8.2+ with Laravel 11, 12 or 13, which matches any actively maintained Filament panel built in the last two years. It is not viable for Filament 3 estates and is irrelevant outside Filament admin surfaces. If your product does not already run Filament, this package is not a reason to adopt it.
- How do I customise the "+ Add" label text?
- Pass a label argument to ->quickAdd(). You can use a string template such as label: "New category: {search}", or a closure like label: fn (string $search) => "Create new: {$search}" for full control. The search term is interpolated into the label shown in the dropdown.
- Does quickAdd respect Filament's create policy and authorization?
- Not by default. Any user who can open the form and search the relationship can create rows in the related table unless you gate it yourself. Add ->quickAdd(enabled: fn () => auth()->user()->can('create', Model::class)) to restrict creation, or wrap the Select in a ->visible() or ->disabled() check. Treat the policy question as a governance requirement before shipping to production.
- Why does quickAdd create incomplete records or throw on my model?
- Only the title attribute, typically name, is populated from the search term, so models with required non-nullable columns, unique constraints, or create events that depend on request context will either throw or silently produce partial rows. Keep Filament's createOptionForm() on complex models that need more than a name or strict validation. There is also no dedupe or normalisation step, so near-duplicates and taxonomy sprawl are a real risk, particularly where case-sensitive matching differs between MySQL and PostgreSQL.
- What does the resetSearch option do in quickAdd?
- By default, after a record is created only the synthetic "+ Add" option is removed from the results, while the search text and remaining results stay visible so users can keep working in the same context. Pass resetSearch: true to fully clear the search input and results after creation. Choose based on whether users typically add several related records in a row.
- Is the new record created when the parent form is saved, or immediately?
- The record is inserted at selection time over Livewire, not in the same transaction as the parent form save. If the user abandons the form, a real record is left behind in the related table. Plan for that with pruning jobs, soft deletes, or by restricting quickAdd to low-risk lookup tables.
- Is cocosmos/filament-quick-add-select safe for production, and what are the alternatives?
- It is a small, single-maintainer package (around 17 stars, no dependents, no broad CI matrix), and early releases shipped a missing namespace declaration and broken translation keys before 1.1.x to 1.3.x stabilised. It overrides Filament internals at the macro level, so a Filament minor release could turn ->quickAdd() into a silent no-op, meaning you should pin versions and cover the flow with a test. The MIT license makes forking viable if you need long-term guarantees. For anything beyond simple name-only lookups, Filament's built-in createOptionForm() remains the safer alternative, and the two can coexist on the same form.