Download the PHP package sudiptpa/filament-turnstile without Composer
On this page you can find all versions of the php package sudiptpa/filament-turnstile. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sudiptpa/filament-turnstile
More information about sudiptpa/filament-turnstile
Files in sudiptpa/filament-turnstile
Package filament-turnstile
Short Description Cloudflare Turnstile form field for Filament v5. Protect any Filament form with a bot-resistant challenge widget.
License MIT
Informations about the package filament-turnstile
Filament Turnstile
A Cloudflare Turnstile integration built for Filament v5 and plain Laravel. Drop TurnstileInput into any Filament form schema, protect the admin login with one line, or use the standalone validation rule and Blade component in any Laravel controller, form request, or view. No CAPTCHA, no image puzzles, just a silent, privacy-respecting bot challenge.
Supported Versions
| Dependency | Version |
|---|---|
| PHP | 8.2, 8.3, 8.4, 8.5 |
| Laravel | ^12.0, ^13.0 |
| Filament | ^5.0 (optional) |
Filament is only required when using TurnstileInput or the bundled Login page. The validation rule and Blade component work in any Laravel application.
Installation
The service provider is registered automatically via Laravel package auto-discovery.
Publish the config file:
Add your Cloudflare Turnstile keys to .env:
Register your domain and get free API keys at dash.cloudflare.com → Turnstile.
Usage
1. Any Filament Form
Add TurnstileInput to any Filament schema like any other field. The widget renders automatically, the token is validated server-side on submit, and nothing is persisted to your model.
The field automatically hides itself when credentials are not configured, so local development without keys works out of the box.
2. Filament Admin Login
Swap the default Filament login page with the bundled one in your panel provider:
The login page renders the Turnstile widget when credentials are present and skips it when they are not. No conditional logic required in your application.
3. Plain Laravel: Blade Component
Use the <x-turnstile /> component in any Blade template. The component accepts optional theme, size, and any additional HTML attributes.
Cloudflare automatically injects a hidden cf-turnstile-response field on challenge completion.
Available props:
| Prop | Default | Options |
|---|---|---|
theme |
auto |
light, dark, auto |
size |
normal |
normal, compact |
4. Plain Laravel: Form Requests
5. Plain Laravel: Controllers
The TurnstileRule resolves its HTTP client from the service container automatically. You can also pass a client explicitly when needed (e.g. in tests):
Custom Key Resolver
By default, credentials are read from config/filament-turnstile.php. If your application resolves keys differently, for example from a database, per-tenant settings, or a secrets manager, implement TurnstileKeyResolverContract and bind it in your AppServiceProvider:
Return null to indicate that credentials are unavailable. The widget will be suppressed and validation skipped automatically. TurnstileInput, the Login page, TurnstileRule, and <x-turnstile /> all resolve credentials through this single contract.
Configuration Reference
Testing Locally
Cloudflare provides official test keys that work on any domain, including localhost, without registration:
| Purpose | Site key | Secret key |
|---|---|---|
| Always passes | 1x00000000000000000000AA |
1x0000000000000000000000000000000AA |
| Always blocks | 2x00000000000000000000AB |
2x0000000000000000000000000000000AA |
| Forces interactive | 3x00000000000000000000FF |
3x0000000000000000000000000000000AA |
Add these to your .env.testing or declare them in phpunit.xml:
Customising the Views
Publish the package views to override the widget HTML:
Views are published to resources/views/vendor/filament-turnstile/.
Running Package Tests
Changelog
See CHANGELOG.md.
License
MIT, see LICENSE.
All versions of filament-turnstile with dependencies
filament/forms Version ^5.0
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0