Looking to hire Laravel developers? Try LaraJobs
This package is not available.

laravel-turnstile maintained by romanzipp

Description
Cloudflare Turnstile package for Laravel
Author
Last update
2026/10/11 11:30 (dev-main)
License
Links
Downloads
194 857

Comments
comments powered by Disqus

Laravel Turnstile

Latest Stable Version Total Downloads License GitHub Build Status GitHub Build Status GitHub Build Status

Cloudflare Turnstile CAPTCHA package for Laravel.

Installation

composer require romanzipp/laravel-turnstile

Configuration

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=

Usage

Laravel Rule

use romanzipp\Turnstile\Rules\TurnstileCaptcha;

$payload = $request->validate([
    'cf-turnstile-response' => ['required', 'string', new TurnstileCaptcha()],
]);

Templates

Document head

Injects the script tag. See method signature for more options.

{{ romanzipp\Turnstile\Captcha::getScript() }}

Form

Injects the form element. See method signature for more options.

{{ romanzipp\Turnstile\Captcha::getChallenge() }}

Manual validation (optional)

use romanzipp\Turnstile\Validator;

$validator = new Validator();
$response = $validator->validate('input-token');

if ($response->isValid()) {
    return true;
}

echo $response->getMessage();

Development

Run Tests

composer test

License

Released under the MIT License.

Authors