davidpiesse/nova-toggle
Add a boolean toggle switch field to Laravel Nova resources with davidpiesse/nova-toggle. Display on/off states as a compact, interactive switch in forms and index views, perfect for flags, active status, and simple true/false settings.
is_active, published, featured, verified), it is a small, measurable reduction in mis-clicks and cognitive load across index, detail, create, and update surfaces — but it does not touch customer experience, revenue, or the product roadmap. Judge it as admin polish, not as product capability.Boolean field. The PM decision is whether to spend a sprint ticket on a custom field or adopt a five-minute dependency. Cost-of-effort favors "buy," but the effort is small enough that "build inline" is a legitimate answer — especially given the 2022 last release, zero dependents, single maintainer, and 85 stars. Treat this as code you may inherit, not a dependency you can rely on for support.exceptOnForms() on the index). If our team never edits from index listings, the marginal benefit over a plain checkbox drops sharply and the whole adoption case weakens. This is the single biggest deciding input.Adopt when:
Boolean::make() → Toggle::make() swap with no migration, no schema change, and no data remediation. Rollback is reverting an import and a make() call — or flipping a config flag if you route field creation through a small factory.Look elsewhere (or keep Boolean) when:
dist/ compiled for Vue 2 mounted into a Vue 3 Nova produces an empty field with no server-side error — clean logs, intact data, broken control. That is the worst failure shape for an internal tool.nullable() with a distinct "unset" state is a checkbox-with-indeterminate problem, not a two-position switch problem. Keep Boolean until null round-tripping is explicitly tested.trueValue() / falseValue() — 'yes'/'no', 1/0 against a string column. Verify inheritance before assuming it works; if it doesn't, that's a fork, not an adoption.acme/nova-fields instead — the endgame either way.is_published in production. For those, use onlyOnDetail(), add a confirmation affordance, and make sure the model fires an attributable event.To executives — the one-liner: This is a small, reversible polish item for our internal admin panel. It replaces plain on/off checkboxes with a standard toggle switch on the screens our ops and support teams use daily, which reduces mis-clicks on production-adjacent flags like "published," "active," and "featured." It is a five-minute, zero-migration change with a one-line rollback, no customer-facing impact, and no schema risk. It should not appear on the roadmap as a feature — it's maintenance-grade work.
What leadership should know about the risk: This is a single-maintainer open-source utility with no release since 2022 and no commercial support. We are not buying a vendor relationship. The mitigation is cheap and must be pre-agreed: pin the exact version, record the validated Nova version in the repo, name an owner, and pre-authorize a fork into our own internal field package if Nova's next major breaks it. At roughly one PHP class, one Vue component, and one compiled asset, forking is hours of work, not weeks. The honest framing is "we are adopting code we may inherit," not "we are taking on a dependency."
To engineering — the ask, in order: Confirm the Nova major version before installing. Read src/Toggle.php to confirm it extends Boolean rather than reimplementing it, and confirm inherited default(), rules(), nullable(), and fillUsing() behave identically. Check whether dist/ is committed and whether it targets Vue 2 or Vue 3 — that one answer decides adopt-versus-fork. Treat an absent or wildcarded laravel/nova constraint in the package's composer.json as a red flag, not a convenience.
Execution plan we're asking for: Inventory and classify every Boolean::make() in app/Nova. Pilot the swap on one non-critical resource in staging — a settings page or taxonomy table, never users.is_active first. Verify the index cell, detail view, create form, update form, and inline index editing. Confirm default()/rules() parity with Boolean. Then roll out per resource under normal PR review. Register the package on the Nova major-upgrade checklist with a named owner. Route field creation through a small factory class so labels and colors stay consistent and there is a one-line config kill switch back to plain checkboxes.
What we will not catch with tests: Server-side tests can prove persistence and policy, not rendering. A broken Vue component renders as a blank field, a raw input, or an empty cell with a 200 response and no server-side error. Visual QA on the pilot page and on any later Nova upgrade is a required release-checklist step, not optional diligence. Keep a written inventory of which fields are now toggles so that QA step is a bounded checklist rather than a hunt.
The decision we want recorded: Adopt narrowly, pin exactly, pilot first, fork pre-authorized. The deliverable is a reusable policy for small single-maintainer UI dependencies as much as it is a nicer switch.
How can I help you explore Laravel packages today?