Download the PHP package coderflex/laravel-turnstile without Composer
On this page you can find all versions of the php package coderflex/laravel-turnstile. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download coderflex/laravel-turnstile
More information about coderflex/laravel-turnstile
Files in coderflex/laravel-turnstile
Package laravel-turnstile
Short Description A package to help you implement the Cloudflare turnstile "CAPTCHA Alternative"
License MIT
Homepage https://github.com/coderflexx/laravel-turnstile
Informations about the package laravel-turnstile
Laravel Turnstile
Laravel Turnstile, is a package to help you implement cloudflare turnstile easily, and with no time.
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Optionally, you can publish the views using:
Turnstile Keys
To be able to use Cloudflare Turnstile, you need to get the SiteKey
, and the SecretKey
from your Cloudflare dashboard
After Generating the keys, use TURNSTILE_SITE_KEY
, and TURNSTILE_SECRET_KEY
in your .env
file
If you want to test the widget, you can use the Dummy site keys and secret keys that Cloudflare provides.
Usage
Turnstile Widget Component
Once you require this package, you can use the turnstile widget in your form, like the following
As you can see, the widget has few options to use. You can know more about them in the configuration section
Turnstile Backend Validation
Once you used the widget component, in the frontend. You can validate Cloudflare Response, by using the validate
method.
Here's an example:
You may, optionally, send the Cloudflare response with the validation method. Something like the following:
Turnstile Custom Rule
If you want clean validation, you can use the TurnstileCheck
custom rule, along with your form validation. Here's an example:
The custom rule, will use the same logic, as the backend validation, but instead will check for the response, and return a validation message, if the captcha fails.
You can change the content of the validation message, in config/turnstile.php
file
PS: If you want to translate the message, just copy the message and translate it, because it uses the translator method behind the scene.
Real Life Example
In your blade file
In your controller:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- ousid
- All Contributors
License
The MIT License (MIT). Please see the License File for more information.
All versions of laravel-turnstile with dependencies
guzzlehttp/guzzle Version ^7.7
illuminate/contracts Version ^10.0|^11.0
spatie/laravel-package-tools Version ^1.14.0