naif/toggle-switch-field
A Laravel Nova field that renders a clean, interactive toggle switch for boolean attributes, making on/off settings easier to scan and edit in your admin panel. Simple to install and configure, it replaces default checkboxes with a polished switch UI.
Architecture fit
naif/toggle-switch-field is a single-purpose Laravel Nova field package: a PHP Field subclass plus a compiled Vue component that swaps Nova's default boolean checkbox for a toggle-switch control on detail and form views. It slots into the standard Laravel package contract — composer.json with extra.laravel.providers auto-discovery, a service provider registering the field's assets, and a dist/ bundle published via nova:publish. Architecturally it is a leaf dependency: it touches no models, migrations, queues, or service-container bindings, so it cannot perturb domain logic. The only coupling is to Nova's internal field API and front-end asset pipeline, which is where the real risk lives.
Integration feasibility
Feasibility is high but conditional. Two hard gates:
nova.laravel.com credentials in auth.json before composer require naif/toggle-switch-field can resolve. This is usually already solved in shops running Nova, but it means the package cannot be evaluated in a public sandbox.Beyond that, integration is a one-line composer require plus a use ToggleSwitchField swap in a resource's fields() method — hours, not days.
Technical risk
^1.0 or something looser.dist/ build, source resources/js present, and no stale lockfile — otherwise you inherit an unbuildable asset.Key questions
composer.json, and is the constraint tested in CI?nullable/tristate semantics?rules(), and resolveUsing honored, or is the toggle purely cosmetic over the underlying boolean?resources/js source present and buildable, and is dist/ current with the tagged release?true/false/null payload as Boolean, so existing filters, metrics, and API resources are unaffected?Stack fit
Best fit is a Laravel 10/11 + PHP 8.1+ + Nova 4/5 admin surface where operators toggle a handful of booleans (feature flags, publish states, notification preferences) and the default checkbox is genuinely ambiguous in the UI. If you are not on Nova, this package is irrelevant — the dependency is total.
Migration path
Replace Boolean::make(...) with the toggle field one resource at a time, keeping the underlying column, cast, and validation untouched. Because the persisted payload is a boolean either way, migration is reversible per-field and carries no schema risk. Where teams have hand-rolled a toggle Vue component or used a CSS hack over Boolean, this is a straight deletion of internal code — a modest maintenance win, which is the package's main real value.
Compatibility
Verify the Nova major against your install before anything else; that is the single most likely blocker. Confirm the composer.json constraints are ^ ranges rather than exact pins, and check the last release date (Jan 2025) against your Nova version's release timeline. Laravel and PHP constraints are almost certainly permissive.
Sequencing
Maintenance
The steady-state burden is near zero if it works — no runtime services, no background jobs, no configuration surface. The burden is concentrated entirely at Nova upgrade time, when you must verify the field still renders. Because there are no dependents, you are the de facto maintainer of last resort. Recommended posture: vendor the source into your repo under an internal namespace, or maintain a thin fork on a private VCS. This is a ~1-day build for a competent Laravel/Nova developer and buys you perpetual upgrade safety on a package that saves you maybe an hour otherwise.
Support
No commercial support, single volunteer maintainer, 6 stars. Escalation path is "open an issue and wait," which for an internal admin UI is tolerable but should be explicitly accepted, not assumed. Do not deploy this on a surface where a rendering bug blocks revenue operations without a tested fallback.
Scaling
Negligible. The field compiles to client-side assets served per Nova page; it adds no query, no API call, and no memory footprint. It does not care about row counts. The only scaling concern is bundle size across many Nova fields, which is a rounding error for a single toggle component.
Failure modes
nova:publish skipped in deploy — control renders blank. Make publish an explicit, idempotent deploy step.1/0 or a string where Boolean submitted true/false) — breaks filters and metrics silently. Test the round-trip explicitly.Ramp-up
Trivial for developers — one use statement, and the field looks like any other Nova field. The actual ramp-up cost is organizational: someone must own the Nova-upgrade check, and someone must hold the auth.json Nova credential. Neither is heavy, but both need a named owner before this ships, otherwise the package quietly becomes nobody's problem until a Nova upgrade takes the admin panel down on a Friday.
How can I help you explore Laravel packages today?