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

Inline Boolean Laravel Package

smart145/inline-boolean

A lightweight Laravel package for inline boolean toggles: flip true/false attributes right from list tables and admin views, with a single click and no full form submission. Easy to wire into Blade or Livewire and simple to customize.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is best understood as a UI interaction pattern, not an infrastructure dependency. It adds a single-purpose control — flip a boolean without a page reload — into an admin surface. The public description advertises a Blade component with a small JavaScript layer posting to a configurable endpoint; the deeper technical notes describe a Nova field class extending Laravel\Nova\Fields\Boolean with a prebuilt Vue bundle in dist/. That divergence is the first thing to resolve: it determines whether this fits a Blade/vanilla-JS admin or a Nova admin, and those are different integration stories with different risk profiles. If you are not on Nova, the field-class path is irrelevant and the Blade framing needs verification against source, since no source excerpt here confirms a Blade component exists.

Integration feasibility. In the narrow case it targets — Nova 3-era stack (Laravel ~6–8, PHP 7.2–8.0), a moderation or visibility toggle, a throwaway container — integration is genuinely a one-liner plus a policy test. Outside that case it is not feasible without forking. There is no service provider, no config file, no migration, no extension surface beyond subclassing. The practical feasibility question is therefore not "can we install it" but "can we afford to own it," and the answer is yes only if we vendor the source into our own package directory.

Technical risk. Three risks dominate, in order:

  1. Authorization bypass (disqualifying). If the toggle posts to a package-defined route instead of Nova's policy-checked field-update endpoint, then the write skips authorizedToUpdate. A list-view control that writes without policy enforcement is a permissions hole, not a UX feature. This must be confirmed before any other evaluation continues.
  2. Silent optimistic failure. An optimistic toggle that rolls back (or doesn't) on a 403/422 leaves the user believing a change saved when it did not. For moderation and account-suspension flags, a false "it worked" is worse than a broken button.
  3. Dead-bundle risk. A compiled Vue 2 bundle from April 2020 will likely fail to register on Nova 4/5 (Vue 3 + Vite) — often silently, rendering an empty cell or a raw true/false. Composer constraints from that era will also hard-fail resolution on PHP 8.2+. --ignore-platform-reqs is not a workaround; a wrong constraint implies a wrong bundle.

Secondary risks: no validation on the inline path (rules and required don't run), no events emitted so dependent fields and metrics go stale, no concurrency handling between two admins, and no audit trail unless we add one.

Key questions.

  • Which is it — Blade component or Nova field? Does the source match the description? This determines the entire integration plan.
  • Does the write go through Nova's field-update endpoint, and does that endpoint enforce the model policy?
  • Does the component roll back visibly on a failed request, and does the next index load show the server value?
  • What is our current Nova major, and does it already support inline boolean editing natively? If yes, the ticket closes here.
  • Who owns this code after we pull it in, and what is the re-review trigger (Nova major upgrade)?
  • Is the boolean in question safe for a one-click write without confirmation, or does it need audit logging and a stricter permission gate?

Integration Approach

Stack fit. Only fits a Nova 3-era application on Laravel 6–8 / PHP 7.2–8.0. On anything newer, treat the package as a reference implementation whose pattern we replicate, not a dependency we install. The Blade claim in the description should be verified before it is used to justify a non-Nova integration.

Migration path. There is no migration path in the upgrade sense — there is a fork path. Two viable options:

  • Reference-implementation path (recommended): spike the package in a throwaway container purely to see the interaction and confirm the request shape. Then scaffold php artisan nova:field in-house, copy the field class, write our own Vue component against laravel-nova's field mixin, and point it at Nova's built-in field-update endpoint. Roughly 1–2 engineer-days, and we own the Nova 4/5 upgrade rather than inheriting a dead one.
  • Vendored-fork path: copy the field class and component into our own nova-components/ package, pin by commit SHA (never a floating version), and record the targeted Nova major in the repo README.

Either way, "install and forget" is off the table.

Compatibility. Confirm against source, not the README: the laravel/nova, php, and laravel/framework constraints in composer.json; the registered component name inside dist/js/field.js; and the exact label/color/state API on the field class. Do not assume method names from the description.

Sequencing.

  1. Day 0 — native baseline check. Does our Nova major already do this? If yes, stop.
  2. Day 0 — request-shape gate. Render the field in a throwaway container, click it once, and inspect the Network tab. The request must be PUT /nova-api/{resource}/{id}/field/{field}. Anything else is a no-go pending fork.
  3. Day 1 — negative-permission test. Write the test that a user without update permission gets 403 and the record is unchanged. Run it even for a spike.
  4. Day 1 — optimistic-failure check. Force a 403 and a 422; confirm the UI reconciles.
  5. Day 2 — classification decision. PM classifies which booleans qualify for one-click toggling versus which stay behind the full form (validation, confirmation, audit).
  6. Day 2+ — build or fork, then standardize through a inlineFlag() helper or trait so every quick-toggle behaves identically across resources.

Operational Impact

Maintenance. We become the maintainer the moment it lands. No CI, no changelog, no security advisories, no issue triage, zero stars, zero dependents, one release in April 2020. Budget a mandatory re-review at every Nova major upgrade and record the pinned commit. This is the single largest recurring cost and it should be stated plainly in any adoption decision.

Support. No upstream support path exists. Internal support means whoever forked it. That argues strongly for the in-house nova-components/ copy — debugging our own readable, rebuildable component is materially cheaper than debugging a prebuilt dist/ bundle with no reproducible build step. Log inline writes explicitly (Log::info or an observer) so we can answer "who flipped this and when" during an incident; Nova's update events do not cover every field-update path uniformly across versions.

Scaling. The mechanism scales fine technically (one small request per click), but two behavioral limits matter operationally: rapid clicking causes write amplification (add an in-flight disabled guard), and concurrent admins diverge silently because there is no realtime channel — the second admin's view only corrects on reload. On the organizational side, the real scaling win is standardization: one toggle behavior, one authorization model, one set of guards across resources, rather than six bespoke implementations drifting between teams.

Failure modes.

Failure Symptom Mitigation
Component never mounts (Vue 2 bundle on Nova 4+) Empty cell or raw true/false, sometimes no console error Vendor/rebuild; check for "Unknown custom element"
Silent rejection Toggle looks green, server value unchanged Negative-permission test; verify rollback; ensure next load shows server truth
Authorization bypass Toggle writes without policy check Disqualifying — fork or do not ship
No validation on inline path Invariant violated (e.g. unpublish an invoiced record) Enforce in model observer or policy method, not in form rules
Stale dependent state published set without published_at; metrics don't refresh Handle side effects in a saving hook/observer so all write paths fire
Stale dashboards Metrics read caches that the inline write didn't invalidate Observer-driven invalidation or refresh on index load
No audit trail Cannot reconstruct who changed a flag Explicit logging at the write path

Ramp-up. Low for a competent Laravel/Nova engineer — the interaction model is obvious and the code surface is small. The ramp-up cost is not learning the package, it's learning that there is no safety net. The four-question debug checklist (field present in fields() for this request? component name resolved in console? request hitting /nova-api/.../field/...? policy true for this user and this model?) isolates almost any failure in about ten minutes. The heavier ramp-up is on the product side: classifying which booleans are safe for a one-click write, deciding the audit-logging and confirmation policy, and setting the org's precedent for adopting unmaintained dependencies. That classification work is the actual deliverable — the package is just the cheap prototype that informs it.

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.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route