Cloudflare Turnstile package for Laravel
romanzipp/laravel-turnstile is a Laravel package for cloudflare turnstile package for laravel.
It currently has 32 GitHub stars and 155.242 downloads on Packagist (latest version 1.4.0).
Install it with composer require romanzipp/laravel-turnstile.
Discover more Laravel packages by romanzipp
or browse all Laravel packages to compare alternatives.
Last updated
Cloudflare Turnstile CAPTCHA package for Laravel.

composer require romanzipp/laravel-turnstile
Copy configuration to project:
php artisan vendor:publish --provider="romanzipp\Turnstile\Providers\TurnstileServiceProvider"
Add environmental variables to your .env:
TURNSTILE_SITE_KEY=
TURNSTILE_SECRET_KEY=
use romanzipp\Turnstile\Rules\TurnstileCaptcha;
$payload = $request->validate([
'cf-turnstile-response' => ['required', 'string', new TurnstileCaptcha()],
]);
Injects the script tag. See method signature for more options.
{{ romanzipp\Turnstile\Captcha::getScript() }}
Injects the form element. See method signature for more options.
{{ romanzipp\Turnstile\Captcha::getChallenge() }}
use romanzipp\Turnstile\Validator;
$validator = new Validator();
$response = $validator->validate('input-token');
if ($response->isValid()) {
return true;
}
echo $response->getMessage();
composer test
Released under the MIT License.