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

Php Antispam Laravel Package

cleantalk/php-antispam

CleanTalk PHP Anti-Spam is a lightweight PHP library that blocks spam form and comment submissions without CAPTCHA. It connects to the CleanTalk cloud service and works with Laravel and other PHP projects.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is a framework-agnostic PHP SDK, not a Laravel package. It has no service provider, config publish, facade, or validation rule out of the box, so integration means writing a thin adapter layer you own (provider + config + rule/middleware). That is a modest, well-bounded amount of glue, but it is code your team maintains. Architecturally it introduces an outbound, synchronous dependency on a third-party cloud API in the request path of every protected form submission — that is the single most important design consequence and needs to be treated as such (timeouts, fail-open policy, observability), not as a drop-in library call.

Integration feasibility. High. Composer install, an API key from a CleanTalk account, and method calls at the points where you currently run CAPTCHA or spam heuristics: registration, login, contact, comments, password reset. The natural Laravel seams are a custom validation rule (for FormRequest usage), a middleware for unauthenticated endpoints, and a listener on the relevant domain events. Expect one to three developer-days including tests, config, and a shadow-mode rollout.

Technical risk.

  • PII egress. Visitor IP, email, and message content leave your infrastructure for a third party. This requires a DPA, a privacy-policy update, and a data-minimization review before any production traffic.
  • Latency and availability coupling. An external call per submission adds tail latency and creates a failure domain outside your control.
  • Fail-open vs. fail-closed. The default behavior when the API is unreachable determines whether you leak spam or block legitimate users; this must be an explicit product decision, not an accident of implementation.
  • Vendor concentration. Pricing, API versioning, and account suspension are external risks. The library's low star count (73) and unknown repository location mean reduced community scrutiny of the client code itself, partially offset by CleanTalk's broad CMS plugin footprint.
  • Testability. Confirm whether the client uses Guzzle/PSR-18 (mockable, observable via Laravel's HTTP client) or raw curl/file_get_contents (harder to fake in CI, harder to instrument). This materially affects your test strategy.

Key questions.

  1. Is there an official or well-maintained Laravel wrapper, or is the adapter ours to own indefinitely?
  2. What are the documented latency expectations, timeout defaults, and uptime commitments for the scoring API?
  3. Exactly which fields are transmitted, how long are they retained, and is a DPA available for our jurisdiction?
  4. Is there a sandbox/test mode and deterministic responses for CI?
  5. What is the supported PHP version matrix, release cadence, and versioning policy?
  6. What is the recommended degradation behavior when the service is unavailable or the key is invalid?
  7. How are false positives adjudicated — is there an audit log or appeal workflow?
  8. Commercial terms: per-site vs. per-request pricing, rate limits, and overage behavior.

Integration Approach

Stack fit. Fits any Laravel version in current support, since it depends on no framework internals. It replaces the server-side verification half of reCAPTCHA/hCaptcha and eliminates the client-side widget, JS payload, and the accessibility and friction costs that come with challenge-based systems. It complements — does not replace — your existing defenses: honeypots, rate limiting, disposable-email checks, and content rules should remain.

Migration path. Do not rip out CAPTCHA on day one. Run CleanTalk in parallel with the existing mechanism in shadow mode for two to four weeks: call the API, log the verdict, but do not act on it. Compare its decisions against your current CAPTCHA outcomes and against known-good accounts (your own test users, partner accounts) to estimate the false-positive rate before it can block anyone. Once the false-positive rate is acceptable, remove the client widget from the lowest-risk form first, keep the challenge as a fallback trigger for flagged submissions for one release cycle, then retire it.

Compatibility. Verify PHP version support against your floor, confirm no conflicting global state or autoloader assumptions, and check that the client can be constructed with an injected HTTP client so you can leverage Laravel's HTTP client, fakes, and middleware for logging. Confirm the package does not write to global error handlers or suppress exceptions silently, which would interfere with your existing exception reporting.

Sequencing.

  1. Spike: install in a branch, verify a real API key returns verdicts, measure latency.
  2. Config and secrets: .env entry, config file, no keys in VCS.
  3. Service provider binding plus a typed wrapper class so application code never touches the vendor API directly.
  4. Custom validation rule and middleware, wired to registration and the contact form first.
  5. Observability: structured logs, a metric for verdict, latency, and error/fallback counts.
  6. Staging validation with representative traffic and a deliberate API-outage test.
  7. Canary on one low-risk form in production.
  8. Full rollout, then remove the CAPTCHA widget and its JS bundle.
  9. Document the fallback policy and the manual-override procedure.

The wrapper class in step 3 is the key decision: it makes a future swap to an alternative provider a contained change rather than a codebase-wide one.

Operational Impact

Maintenance. Small but non-zero. You own the adapter, the config, and the dependency pin. Track upstream releases (the cadence looks active) and review changelogs before bumping. Pin to a minor range and let automated dependency tooling open PRs; the glue code should rarely need changes, but it is not zero-touch like a first-party Laravel package would be.

Support. Two tiers: CleanTalk supports the service and account, while the PHP client itself has limited community support given its adoption level. Establish the vendor escalation path (account manager, support SLA) before launch, and keep the API key and account ownership in a shared, documented location rather than one engineer's inbox.

Scaling. Cost and latency scale linearly with form submissions, which is usually a small fraction of total traffic — acceptable. Protect the request path with a short timeout (roughly one to two seconds), a local circuit breaker, and a defined fallback. For high-volume, low-risk surfaces (comments, newsletter signups) consider a non-blocking check with post-hoc moderation rather than a synchronous verdict; keep registration synchronous because the decision must be made before account creation. Cache nothing about the verdict that could be stale across sessions without thought.

Failure modes and required mitigations.

  • API timeout or 5xx: fail open, apply existing local defenses (honeypot, rate limit), log, and alert. Fail-closed is defensible only if you accept blocking legitimate users during vendor incidents.
  • Invalid or expired API key: many clients degrade to "allow everything" silently. Add a startup or scheduled health check that asserts a known-spam sample is flagged.
  • Rate limiting (429): exponential backoff with jitter; alert if sustained.
  • False positives: provide a support workflow to unblock users and an internal allowlist; track the rate weekly.
  • False negatives: spam leaks into the product; monitor report volume and moderation queue depth as a proxy.
  • Privacy incident or subject-access request: know what is retained where, and have a deletion path.

Ramp-up. Developer: low — the API surface is small and the integration is a day or two of focused work plus tests. Operations: medium — the real work is the runbook, dashboards (verdict mix, latency, error and fallback rates), and alerting thresholds. Support and product: a documented false-positive review process and a customer-facing explanation of why no challenge is shown. Budget one sprint end-to-end including the shadow-mode observation window; the observation window, not the coding, is the critical path.

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/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
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