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

Nova Switcher Laravel Package

trin4ik/nova-switcher

A Laravel Nova field that renders a boolean toggle switch for your resources, letting users flip true/false values inline with customizable on and off labels and a clean, native-looking control.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. trin4ik/nova-switcher is a single-purpose Laravel Nova field plugin, not an application-layer component. Structurally it is a PHP field class extending Laravel\Nova\Fields\Field plus a compiled Vue component registered via ->component(). It sits entirely inside the Nova admin presentation layer: it reads and writes one boolean attribute through Nova's standard fill/update pipeline and touches nothing else — no routes, no service providers beyond asset publishing, no migrations, no middleware, no data model. That is the best possible blast radius for a dependency, and it is also the ceiling on its value: it changes one cell's rendering in an internal admin panel.

Integration feasibility. Mechanically trivial — composer require, vendor:publish, one line in fields(). But feasibility is gated by a dependency the package does not declare loudly enough: a licensed Nova install of a compatible major. The last release (2023-11-01) lands in the Nova 4.x era. Nova custom fields are the most upgrade-fragile surface in the ecosystem because they couple to the host's Vue runtime and asset pipeline, so "compatible with Nova 4.x-era" is a claim about a moving target, not a stable contract. For any team on Nova 4 or 5 today, the core Boolean field already renders an inline index toggle, which makes the package's headline feature native and this dependency redundant.

Technical risk. High relative to the value delivered, driven almost entirely by lifecycle rather than code quality:

  • Archived upstream — no Nova-major compatibility work, no security patches, no bug fixes. The repo will never move again.
  • Zero dependents — no compatibility evidence from the field. Nobody has exercised edge cases in production on our behalf.
  • Silent failure mode — the realistic first-run outcome of a stale custom field is a blank cell or a toggle that renders but does not persist. No stack trace, no error log; you find it in the browser console or when an operator reports a flag that "won't stick."
  • Licensing — copying archived source into a commercial codebase is a licensing act; an absent or ambiguous license file is a genuine blocker for the fork path.
  • Signal cost — it produces "abandoned package" warnings in composer audit, which trains teams to discount audit output.

Key questions.

  1. What Nova major are we on, and does core Boolean already satisfy the requirement? (If yes, this evaluation ends here.)
  2. Is the toggle surface strictly internal, low blast radius, and reversible — or does it touch billing, entitlements, permissions, or anything customer-facing?
  3. Who owns this field on the next Nova upgrade, and where is that recorded?
  4. Do we have a policy on unmaintained dependencies, and does an exception get approved for a cosmetic admin win?
  5. Is the license permissive enough to vendor the source if we go that route?
  6. Do we need accessibility conformance, localization, or a confirmation guard on destructive toggles? (Nothing suggests any of that was validated.)

Recommendation: decline adoption as a dependency. Use Nova's Boolean field, or spend roughly half a day on an owned field via php artisan nova:field. Retain the source as a pattern reference only.

Integration Approach

Stack fit. Requires Laravel + licensed Nova; it is inert without Nova. Not portable to Filament (ToggleColumn/Toggle are first-class there), Livewire, or Backpack — those stacks have their own equivalents and should use them. Within a Nova codebase the field integrates through standard extension points only: ->rules(), ->help(), ->canSee(), ->readonly(), ->onlyOnIndex(), ->sortable(), ->default(false). There are no package-specific configuration surfaces to plan around, which simplifies design but also means anything beyond a plain binary switch is our work, not theirs.

Migration path. Three options, ranked by total cost of ownership:

  1. Configure (preferred). Nova's first-party Boolean — zero dependency, zero maintenance, already inline-toggleable on Nova 4/5. Verify empirically on the target resource before closing the ticket.
  2. Build (preferred if the ergonomics genuinely differ). Copy the PHP class and Vue component into app/Nova/Fields or a private nova-components package, compile with our own Nova tooling against our installed Nova version, and drop the Composer dependency. Half a day, and the field becomes ours on every future Nova major.
  3. Buy/adopt (weakest). Pin the exact version in composer.json (e.g. "trin4ik/nova-switcher": "1.0.0") so a future composer update cannot resolve a different artifact from a dead repo. Record the license check and provenance note.

If option 3 is taken anyway, treat it as a deliberate stopgap tied to a Nova upgrade milestone, not a durable choice.

Compatibility. Unverified against current Nova majors. Before any commitment, two read-only checks close most of the risk: confirm the exact FQCN in src/ and whether the component targets Vue 2 or Vue 3 and which laravel-nova build. Then wire it to one boring boolean (is_active on an internal model), flip it in the index view, reload, confirm the DB column changed, and open the console. A blank cell with console errors is the signal to stop and reimplement rather than debug an unowned artifact.

Sequencing. (1) Confirm Nova version and evaluate core Boolean first — highest-leverage, near-zero cost step. (2) If insufficient, license/provenance check on the archived repo. (3) Decide build vs. adopt before writing any resource code. (4) If adopting, pin the exact version and add an audit-ignore entry deliberately. (5) Prove out on one internal boolean behind a filter or lens. (6) Add a regression test asserting the save round-trips the boolean, so future Nova upgrades fail loudly in CI rather than silently in the UI. (7) Attach a named owner and add "regression-check switcher field" to the Nova upgrade checklist.

Data-model prerequisites. The column must be in $fillable (or unguarded) and cast to 'boolean'. Skipping the cast is the classic source of "0"-is-truthy bugs. Nullable booleans are a design mismatch — a switch is binary by construction; either default to false or use a Select for Yes/No/Unset.

Operational Impact

Maintenance. This is the decisive cost. An archived repo transfers 100% of maintenance to us with no upstream to absorb Nova-major churn. The field will break at some future Nova upgrade and we will fix it ourselves — at which point we have effectively forked it while still carrying the dependency and its audit noise. Ownership must be explicit and named; an unowned custom field nobody remembers is exactly how admin panels break at upgrade time.

Support. None. No issue triage, no security response, no compatibility statements. If an operator reports a broken toggle, there is no vendor to escalate to and no dependents to check for known workarounds. Internally, first-line support is whoever owns the Nova upgrade checklist.

Scaling. Functionally a non-issue — the field is O(1) per rendered row and adds no queries, jobs, or services. The scaling concern is organizational: every additional Nova resource using it widens the surface that must be re-verified at each Nova major, and the marginal ergonomic benefit per resource is small. Twelve stars and zero dependents means adoption breadth is not a de-risking factor available to us.

Failure modes.

  • Silent render failure after a Nova upgrade — blank cell, no stack trace. Detectable only via console inspection or an operator complaint.
  • Silent persistence failure — toggle renders but does not save; state appears to change and then reverts on reload. Highest-trust-damage mode because operators believe the flag was set.
  • Truthiness bugs from a missing boolean cast ("0" evaluating truthy).
  • Unaudited destructive toggles — a single click publishing content or pausing a subscription with no confirmation guard. The package does not provide one; that is our build.
  • Accessibility/localization gaps — no evidence keyboard semantics or ARIA state were validated. Disqualifying if those obligations attach to the control.
  • Audit noise degrading the team's response to genuine dependency risk.

Ramp-up. Effectively zero for engineers familiar with Nova — one line in fields(), one vendor:publish. The real ramp-up is organizational: establishing the ownership record, the upgrade-checklist entry, the license determination, and the regression test before the field spreads. Budget half a day for the build-your-own path versus roughly an hour to adopt plus an unbounded tail of future upgrade rework.

Bottom line for planning. Treat this as admin-tooling backlog hygiene worth hours, not a roadmap line item, and do not let it displace customer-facing work. There is no customer-facing, revenue, or data-model impact. The demand signal — 12 stars, zero dependents, archived upstream — suggests the need is already met by Nova core. Net recommendation: decline adoption, park the capability, and revisit only on explicit ops request.

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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource