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

Livewire Honeypot Laravel Package

darvis/livewire-honeypot

darvis/livewire-honeypot provides lightweight honeypot spam protection for Livewire forms, blocking bots without CAPTCHAs or friction for real users. Simple to install and configure, it integrates cleanly with Laravel and existing Livewire components. No JavaScript required. Drop-in protection.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Package profile: A small, single-purpose Laravel/Livewire spam-mitigation package implementing the honeypot technique (a hidden form field that humans don't fill and naive bots do). No external service, no data store, no credentials, no network egress.

Architecture fit

  • Fits cleanly into a standard Laravel + Livewire stack: a Blade component for the field, a trait/validate() call for server-side enforcement, and optional config/views.
  • Stateless and side-effect free — no migrations, queues, caches, or third-party API dependency. This makes it trivially reversible and safe to trial in a single form before wider rollout.
  • Scope is deliberately narrow: it addresses only unsophisticated bots. It is a layer, not a substitute for rate limiting, CSRF, input validation, or a challenge-based CAPTCHA on high-abuse endpoints. Position it as defense-in-depth, not the primary control.

Integration feasibility

  • Low ceremony: composer require, add <x-honeypot /> to forms, call validate() (plain forms) or validateHoneypot() (Livewire components) in the submit path.
  • Two distinct integration paths (plain HTTP forms vs. Livewire components) with different failure characteristics — the release notes show these paths have historically diverged in behavior and test coverage.
  • Total engineering effort is small (typically well under a day for a first form, one to three days for a full audit-and-rollout across an application with many forms), but the audit of existing usages is the real cost driver in 1.6.0.

Technical risk

  1. Silent-rejection defect (fixed, high severity historically). In applications running Laravel's default ConvertEmptyStringsToNull middleware, every genuine plain-form submission was rejected as spam: the middleware coerced the empty hidden field to null, and validate() interpreted null as "field absent" rather than "field present but empty." The 1.5.1 documentation shipped a manual array_map(fn ($value) => $value ?? '', ...) workaround, which tells us the defect was known and documented before it was fixed. If any product surface uses this package on plain forms and was integrated against an older version, assume conversion loss occurred and validate against analytics before and after.
  2. Silent security no-op (fixed, requires manual remediation). On Livewire, <x-honeypot wire:model="..." /> bound to a non-default property was never actually validated — validateHoneypot() unconditionally read hp_website. Forms using the attribute form of the component were unprotected. This is a security-relevant fix with no automatic migration: each affected view must pair the wire:model path with matching validateHoneypot(model: ..., errorKey: ...) arguments, and the bound property must start as an empty string. Any team that assumed coverage from the presence of the component should treat prior "no spam" telemetry as unverified.
  3. Behavior change (loud failure). HasHoneypot on a Livewire form object or any non-component class now throws LogicException from validateHoneypot() with a directive message. This only surfaces configurations that were already 100% broken (no mount hook → no start time → every submit rejected), so it converts a silent outage into a diagnosable exception. Net positive, but it is an uncaught-exception risk on any submit path that reaches production untested.
  4. Test-coverage signal. The release adds a feature test that exercises the real middleware stack without withoutMiddleware() — a direct response to risk #1. The prior absence of such a test is the underlying quality concern: unit tests that bypass middleware cannot catch middleware-interaction bugs, which is exactly the class of bug that produced a full-fidelity outage.
  5. Maintainer concentration. Small, single-maintainer package. Low absolute impact (a honeypot can be hand-rolled in ~50 lines if abandoned), but plan for the possibility of no upstream fixes.

Key questions

  • Which released versions are affected by the ConvertEmptyStringsToNull rejection and the Livewire wire:model no-op? Is there a published advisory/CVE, or only release notes?
  • What are the supported Laravel and Livewire version ranges for 1.6.0, and is Livewire 2 vs. 3 behavior identical?
  • Is validate() still documented as the primary plain-form entry point, and does the new middleware-stack test cover both passing and failing cases (present-but-null, absent, filled)?
  • For the Livewire fix: is the model argument a literal property path string rather than a bound value, and does it follow nested/wire:model.live binding semantics?
  • Accessibility: does the rendered hidden field carry aria-hidden, tabindex="-1", and autocomplete="off" so it is not surfaced to screen readers or password managers?
  • What is the maintainer's release cadence and support policy for the current major line?

Integration Approach

Stack fit

  • Requires an existing Laravel application using Blade; Livewire support assumes a Livewire component-based form. No infrastructure, secrets, or environment configuration needed — it deploys identically across local, staging, and production.
  • Complements, and does not conflict with, existing throttling middleware, CSRF, and validation. It should be sequenced after those in the request lifecycle discussion, but there is no ordering constraint in code beyond calling validate() before persisting.

Migration path

  1. Pin the dependency and upgrade to 1.6.0 rather than adopting an earlier version — the two fixes are the reason to move, and there is no reason to onboard onto a version with a known full-rejection defect.
  2. Plain forms: upgrade, then remove the array_map(fn ($value) => $value ?? '', $request->all()) workaround if it was applied; leaving it is harmless but it is dead code that obscures intent. Confirm validate($request->all()) matches documented usage.
  3. Livewire forms: run a repository-wide search for <x-honeypot wire:model=. For each hit, pass the identical path and error key into the component call — $this->validateHoneypot(model: 'contact.hp_website', errorKey: 'contact.hp_website') — and verify the bound property is initialized to ''. Treat each hit as a security finding until the pairing is verified in code review, not just by grep-and-edit.
  4. Attribute-less usage: <x-honeypot /> requires no change; validateHoneypot() with no arguments preserves prior behavior, so untouched call sites are backward compatible.
  5. Trait placement: if LogicException appears, move the trait and the validateHoneypot() call from the form object to the Livewire component. Budget for this only if the exception actually surfaces — it indicates a previously broken integration, so treat it as a bug fix, not a regression.

Compatibility

  • Defaults for the new validateHoneypot(?string $model, ?string $errorKey) arguments preserve existing call signatures; components that define their own validateHoneypot() keep working. The only non-additive change is the LogicException, which affects code paths that were already non-functional.
  • Confirm Laravel/Livewire version ranges against the application's pinned versions before scheduling, particularly if the application is mid-upgrade on Livewire.

Sequencing

  1. Land the upgrade with no behavioral changes on attribute-less usages; deploy to staging and verify submission success rates on plain forms (this is the metric the bug corrupted).
  2. Inventory wire:model honeypot usages; remediate and review the pairs.
  3. Remediate any LogicException sites found in staging smoke tests.
  4. Instrument acceptance/rejection counters per form, deploy, and compare before/after for 48–72 hours.
  5. Retroactively reconcile pre-upgrade conversion data on any plain form that was silently rejecting submissions.

Operational Impact

Maintenance

  • Near-zero steady-state cost: no runtime dependencies, no migrations, no configuration drift, no scheduled jobs. Upgrades are rare and small.
  • The 1.6.0 notes are a reminder to keep a pinned version and re-read release notes on upgrade: two of the four changes were silent-failure-class issues, and one carried a mandatory manual remediation step for existing views.

Support

  • Failure modes are legible once you know them: rejected submissions surface as "Spam detected." on legitimate users, which support staff must be able to distinguish from validation errors. Add a runbook entry that maps that exact message to the honeypot check and to the trait-placement LogicException.
  • The LogicException message is self-describing ("move the trait to the component"), which lowers escalation cost considerably compared with the prior silent behavior.
  • Security remediation for the wire:model variant should be handled through the normal vulnerability workflow (owner, ticket, verification), not as routine maintenance.

Scaling

  • Scales trivially: the check is a single in-memory field inspection on the submit path with no I/O. Cost is negligible relative to any persistence or email operation.
  • Effectiveness does not scale with traffic — a honeypot degrades against bots that render pages or submit all fields. For forms under sustained abuse, layer rate limiting and a challenge mechanism; the honeypot remains the cheap first gate.

Failure modes

  • False positive (legitimate user rejected): the historical 1.6.0 bug class. Detect via a drop in successful submissions coincident with a deploy, or a spike in the "Spam detected." message. Mitigate by monitoring acceptance rates as a first-class metric per form.
  • False negative (bot passes): expected against sophisticated bots; detect via downstream spam volume (fake accounts, junk contact records), not via the package.
  • Silent no-op (control believed present but absent): the Livewire wire:model case. Only detectable with a negative test (assert a filled hidden field is rejected) per form; make that assertion part of the form's test suite.
  • Uncaught LogicException: a 500 on submit for misconfigured components. Surfaces immediately in staging smoke tests; low production risk if submit paths are exercised pre-deploy.
  • Abandonment: low impact; an equivalent check is a small, well-understood function to reimplement in-house if needed.

Ramp-up

  • One to two hours for an engineer to read the docs and integrate a first form; the concept requires no new mental model beyond "hidden field must be empty and present."
  • The skill that matters is diagnostic, not architectural: recognizing that "Spam detected." on all real submissions indicates an integration defect (middleware coercion, trait misplacement, or property-name mismatch) rather than genuine bot activity. Document that triage path before rollout so on-call and support do not misattribute an outage to an attack.
  • Recommended first milestone: one low-risk form (contact or newsletter) with acceptance-rate instrumentation, then a repository-wide audit of existing usages, then the security remediation of wire:model-bound components.
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.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core