Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Toggle Switch Field Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  1. Nova licensing. Nova is a paid, private-repository package. Any CI runner, container build, or new developer machine needs 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.
  2. Nova major-version pinning. The package must be checked against your Nova 4.x or 5.x line. Nova's field API and Vite/Mix asset pipeline changed across majors; a field built for one major typically fails silently (component not registered) rather than throwing.

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

  • Bus factor of one, unvalidated adoption. 6 stars and 0 dependents means effectively zero production signal. There is no ecosystem evidence that this field survives real Nova upgrades, and no community to surface regressions.
  • No leverage. If it breaks, you cannot wait for a community fix; you fork or you replace. The entire package is plausibly under ~150 lines of PHP/Vue.
  • Semver discipline unknown. Verify whether the maintainer tags breaking changes appropriately and whether the constraint is ^1.0 or something looser.
  • Front-end hygiene. Check for a committed dist/ build, source resources/js present, and no stale lockfile — otherwise you inherit an unbuildable asset.
  • Silent failure mode. A mis-registered field renders as nothing or falls back to a plain input; there is no loud error. This needs an explicit smoke test.

Key questions

  • Which Nova majors and Laravel/PHP versions are declared in composer.json, and is the constraint tested in CI?
  • Does the component support index/inline-edit views, dark mode, RTL, disabled/read-only states, and Nova's nullable/tristate semantics?
  • Is validation, rules(), and resolveUsing honored, or is the toggle purely cosmetic over the underlying boolean?
  • Is resources/js source present and buildable, and is dist/ current with the tagged release?
  • What is the license, and is there any security disclosure path?
  • Does it emit the same true/false/null payload as Boolean, so existing filters, metrics, and API resources are unaffected?

Integration Approach

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

  1. Spike (half day): install in a scratch Nova app, render the field on one resource, confirm value round-trip, dark mode, and validation pass-through.
  2. Decision gate: if the field is >1 day from "acceptable," stop and write it in-house.
  3. Pilot: one resource in staging, one sprint of operator use.
  4. Rollout: remaining resources behind a PR each, so any regression is bisectable.
  5. Contingency: budget for replacement by an internal fork (see below); do not treat this as a permanent dependency.

Operational Impact

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 major upgrade breaks the component — highest likelihood; presents as a missing or unstyled control. Mitigate with a rendered-page smoke test in CI (Dusk or Playwright on one Nova resource).
  • Asset not published / nova:publish skipped in deploy — control renders blank. Make publish an explicit, idempotent deploy step.
  • Private Nova repo auth missing in CI — build fails outright, which is at least loud.
  • Payload drift (field submits 1/0 or a string where Boolean submitted true/false) — breaks filters and metrics silently. Test the round-trip explicitly.
  • Package abandonment — no immediate breakage, but compounding upgrade debt. The vendored/forked posture removes this entirely.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core