topthink/think-captcha
topthink/think-captcha provides easy CAPTCHA integration for ThinkPHP applications, generating customizable image-based verification codes and validating user input. It supports configuration, session-based checks, and simple controller/template usage, making form spam protection quick to add.
check() verification call — roughly 100–200 lines of code you would otherwise own, test, and patch. Buying (or rather, adopting) wins on time-to-ship for internal tools; building wins only if you need custom challenge types.mews/captcha, gregwar/captcha, or a hosted provider (hCaptcha/Turnstile). The decision this supports is "which framework-consistent default do we standardise on," and the answer here is ThinkPHP-only.NOASSERTION licence, this is a convenience dependency, not an ecosystem commitment. That distinction should drive the decision: adopt it behind an interface you control, so it is swappable.Consider it when:
Look elsewhere when:
NOASSERTION is an assessment blocker, not a footnote — legal should confirm redistribution and commercial-use terms before this ships in a distributed or client-delivered product. If legal cannot get a clear answer, treat it as unadoptable.Net PM read: a reasonable, low-cost convenience for a ThinkPHP monolith — adopt with a wrapper interface, a licence clearance, and a scheduled re-evaluation point. Do not let it onto the roadmap as the long-term answer to bot traffic.
For executives (30 seconds): This is a small, free, self-hosted CAPTCHA component for our ThinkPHP application. It lets us put human verification on login and public forms in a few days rather than a few weeks, with no per-request vendor fees and no data leaving our infrastructure. The tradeoffs are honest ones: it is a niche open-source component with a single maintainer and an unclear licence, and image CAPTCHAs are a speed bump, not a wall. My recommendation is to use it as a tactical fix, wrap it so we can replace it without touching product code, and clear the licence with legal before it goes anywhere client-facing. It is not the strategic answer to bot traffic — that decision is still open, and I would bring a hosted or behavioural option back once we have abuse numbers.
For engineering: Small ThinkPHP 6/8 library — generates a CAPTCHA image, stores the code in session, exposes a check() verification call. Integration is low effort: route, controller action, a form field, and a middleware or manual check on the protected endpoint. Two constraints to design around: (1) it is framework-specific — no Laravel path, so if we are multi-framework we need a thin CaptchaVerifier interface with per-framework implementations; (2) session coupling means we must confirm it behaves under our load-balanced, multi-instance setup, or move to a shared session store. Licence is NOASSERTION — flagging for legal before we vendor it. Pin the version, note the 2024-11-22 release date, and plan to fork if we need patches. I would also add a task to test the audio/accessibility path, since that is the most likely place this bites us in production.
One-line justification for the roadmap: lowest-effort, zero-marginal-cost reduction in automated form abuse on our ThinkPHP surface — adopted as an interim control, with a wrapper and an explicit re-evaluation date.
How can I help you explore Laravel packages today?