stepanenko3/nova-boolean-group-field
A Laravel Nova field for grouping multiple boolean attributes into one compact control, making related true/false options easier to view and toggle in admin panels. Useful for permissions, settings, feature flags, and other grouped on/off choices.
Architecture fit
This is a Laravel Nova custom field — an admin-layer UI extension, not a runtime service, API dependency, or domain model. Its architectural footprint is deliberately shallow: it renders a grouped checkbox control in a Nova form and persists selections as a JSON/array attribute on an Eloquent model.
That makes it a good fit under a narrow set of conditions:
It is a poor fit when grouped booleans need per-flag audit history, conditional logic, frequent expansion, customer-facing controls, compliance-grade permissioning, or multi-tenant isolation. At that point the JSON attribute becomes a liability — the package is not the problem, the storage shape is — and the correct move is a user_preferences-style table or first-class model.
Integration feasibility
Superficially high: composer require, a nullable JSON column, an array cast, and a field registration in the Nova resource. The real feasibility questions are less obvious and need to be answered from the source before any commitment:
Laravel\Nova\Fields\BooleanGroup, or does it ship its own Vue components and frontend conventions?dist/, or does the host app need a Node build step? A missing dist/ renders an empty div with no console error — a silent failure that costs engineering hours.options(), defaults, layout)? The README is thin; vendor/.../src/ is the actual documentation.composer.json constrain for php, laravel/framework, and nova? Last release is March 2024, so Nova 4.x is the safe assumption and Nova 5 must be smoke-tested, not assumed.Technical risk
The dominant risk is maintenance, not correctness. Signals: 7 stars, zero dependents, a single release note in v1.0.3 that is only a changelog link, and no visible test suite. There is no vendor support path and no community backstop. Concretely:
$fillable/$guarded or a missing array cast produces a form that saves nothing or an array_merge that fails obscurely. These are configuration risks the team controls, but they are the most common confusion point.Rule::in on keys, typos persist.authorize(). This must be verified, not trusted.Key questions
BooleanGroup — and is its storage format byte-compatible with native, so rollback is a one-line change?authorize() work, and does it apply to the field rather than only the resource?Stack fit
Requires Laravel + Nova already in place. Do not add Nova to obtain this field — the cost/benefit collapses immediately. Verify composer.json constraints against our PHP, Laravel, and Nova versions before writing any code. Treat Nova 4.x as the supported baseline and Nova 5 as unverified until proven.
Migration path
For a new attribute (the recommended entry point), the path is short:
jsonb on Postgres) and the array cast in the same commit — never the cast alone, never the column alone.For swapping out native BooleanGroup on an existing column, the path is different and stricter: prove read/write parity on a disposable resource first. If formats diverge, write a one-time backfill and keep the old field live until parity is demonstrated. Do not migrate data on the assumption of compatibility.
Compatibility
nullable, array, and a key-whitelist rule. Guard the "submit with nothing checked" path, which can yield null rather than an all-false object.dist/ exists in vendor before deploy.Sequencing
App\Nova\Fields\PreferenceGroup with options sourced from config, nullable/array rules, key whitelist, and a resolveUsing defaults merge. Keep direct package references confined to this one file.hideFromIndex() plus a displayUsing readable summary.Maintenance
Ongoing cost is low in engineering hours but not zero in attention. The package is effectively unmaintained-by-default: 7 stars, zero dependents, one thin changelog release, no visible tests. Plan on the team absorbing the regression surface. The wrapper pattern converts a potential multi-file refactor into a one-file change, and that is the single most important operational decision here.
Support
There is no vendor support. Internal ownership must be explicit: a named engineer, a pinned version in composer.json, and a documented fallback to native BooleanGroup. Without that, this becomes an orphan dependency discovered during a Nova upgrade under time pressure.
Scaling
Scaling concerns here are not traffic — this is admin UI — they are design scaling:
->options() entry.Failure modes
| Failure | Symptom | Mitigation |
|---|---|---|
Missing $fillable / $guarded |
Form renders, nothing saves — silently | Check first on any save failure; cover with a round-trip test |
Missing array cast |
array_merge blows up on a string |
Ship cast and migration in the same commit |
No prebuilt dist/ |
Empty div, no console error | Verify vendor/.../dist before deploy |
| Nova upgrade | Field breaks on major bump | Pin Nova + package together; re-run CRUD/validation/permission pass on every bump |
| Unknown keys persisted | {"typo_key": true} in the JSON |
Rule::in on keys at the validation layer |
null vs all-false |
Read-side merge fails on empty submit | Defaults merge on read; test the nothing-checked path explicitly |
| Missing field authorization | Restricted user edits flags | Verify authorize() applies to the field, not just the resource |
| Format divergence from native | Rollback requires migration | Prove parity before adopting on existing columns |
Ramp-up
Low for any engineer already fluent in Nova: the API mirrors native BooleanGroup, so the field itself is minutes of work. The learning is in the JSON-column discipline — defaults-merge on read, key whitelisting, storage-shape separation from API contracts — and in the rollout discipline: pin, wrap, test, document the exit ramp. Budget a half-day spike plus one focused day for wrapper, pilot, and test. The larger organizational task is the decision boundary: framing this as an internal admin efficiency lever with a named owner and a pilot scope, and not letting it drift into a customer-facing or compliance-adjacent dependency without a deliberate re-evaluation.
How can I help you explore Laravel packages today?