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

Product Decisions This Supports

  • Admin-panel UX consistency (build vs. buy): The package supplies a ready-made toggle-switch input for Laravel Nova boolean fields. The decision it informs is narrow but real: whether to ship a polished switch control in internal admin tooling now, or spend engineering time building and maintaining a custom Nova field component. At ~a few hours of in-house effort versus near-zero integration cost here, this is a "buy by default, fork if needed" call.
  • Boolean-state modeling in the product: Toggle switches are the natural control for the fastest-moving states a PM cares about — is_active, is_published, is_featured, accepts_new_signups, per-record feature gates. Adopting a consistent switch component makes those states legible to ops and support staff, which reduces mis-clicks and support tickets compared with dropdowns or raw checkboxes.
  • Roadmap sequencing for internal tooling: Because the package is a pure presentation layer with no backend behavior, it can be slotted into any admin-panel polish milestone without touching domain logic. That makes it a low-risk "ride-along" item rather than a standalone roadmap line.
  • Scope discipline on feature flags: This is a UI input, not a feature-flag platform. A PM should explicitly decide not to let a toggle-switch field become the de facto flag system — if you need staged rollout, targeting, or audit trails, that's a separate build-vs-buy evaluation (LaunchDarkly/Unleash/Flagsmith-class tooling), and this package should not be cited as covering it.
  • Vendor and dependency posture: With 6 stars, 0 dependents, and a single maintainer, adoption is effectively a decision to own the code. That is acceptable for a ~100-line front-end field inside a paid Nova admin panel, and unacceptable for anything on the customer-facing critical path. The PM decision is to classify it as "internal tooling, fork-on-adopt" rather than "strategic dependency."

When to Consider This Package

Adopt when all of the following hold:

  • You are already running Laravel Nova (this is a Nova field — it provides no value outside Nova, and Nova itself is a paid, licensed product, so the TCO includes that license).
  • You need a boolean toggle in an admin resource and want visual consistency across resources without writing a custom field.
  • Your team accepts taking ownership of the source: pin the version, vendor or fork the field into your codebase, and review the compiled JS/CSS before it reaches production. With one maintainer and a negligible install base, expect no meaningful community bug-fixing or security response.
  • The blast radius is internal and reversible — a broken toggle in an admin panel degrades operator experience, not customer transactions.
  • You have confirmed Nova major-version compatibility (Nova's field API has shifted across v4/v5); verify against your installed Nova version rather than trusting the release date alone.

Look elsewhere (or build in-house) when:

  • You are not on Nova — use Filament, Laravel Nova alternatives, or plain Blade/Livewire components; nothing here transfers.
  • You need auditability: who flipped the switch, when, and why. A toggle field records nothing; you need model events, an activity log (e.g., spatie/laravel-activitylog), and probably a reason field.
  • You need guarded or permissioned toggles — irreversible or high-consequence states (billing, payouts, data deletion) should be a confirm-modal or typed-confirmation pattern, not a one-click switch.
  • You need real feature-flag semantics (percentage rollout, per-tenant targeting, kill switches with runtime evaluation). Use a dedicated flag service.
  • Your organization has strict supply-chain policy (SBOM, signed releases, maintained-dependency SLAs). A 6-star, single-maintainer package will not clear review — though the mitigation is trivial: copy the component into your repo.
  • The native Nova boolean field is good enough for your design language. Adding a dependency for cosmetic parity is a poor trade if the default already passes design review.

How to Pitch It (Stakeholders)

For executives (one line): A small, free UI add-on for our admin panel that makes on/off settings clearer for the operations team — low cost, contained risk, easy to remove.

For engineering: naif/toggle-switch-field is a Laravel Nova field that renders a boolean attribute as a toggle switch instead of a checkbox. It is presentation-only — no migrations, no service provider magic beyond field registration, no runtime behavior in the application. Integration is a composer require plus one line in the Nova resource.

The honest risk profile: 6 GitHub stars, zero dependents, single maintainer, most recent release January 2025. That is not a red flag for a component this small, but it does mean we should treat adoption as a fork, not a dependency: pin the version, vendor the source, and review the field's JS/CSS before it ships. Cost of exit is effectively zero — worst case we reimplement a toggle in an afternoon.

Recommendation: Approve for internal admin tooling only, scoped to boolean fields where a one-click state change is appropriate. Do not position it as our feature-flag solution, and do not use it for irreversible or financially material actions without a confirmation step layered on top. If design approves the native Nova boolean control, skip the package entirely and revisit only if operators report confusion.

Success signal: ops and support staff can change record states without asking engineering, and we see no increase in mis-set flags. Kill signal: Nova upgrade friction, or any incident traced to an unintended toggle flip — in either case, revert to a confirm-gated control.

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
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
cgv/localized-resource