Download the PHP package ryangjchandler/laravel-cloudflare-turnstile without Composer
On this page you can find all versions of the php package ryangjchandler/laravel-cloudflare-turnstile. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ryangjchandler/laravel-cloudflare-turnstile
More information about ryangjchandler/laravel-cloudflare-turnstile
Files in ryangjchandler/laravel-cloudflare-turnstile
Package laravel-cloudflare-turnstile
Short Description A simple package to help integrate Cloudflare Turnstile.
License MIT
Homepage https://github.com/ryangjchandler/laravel-cloudflare-turnstile
Informations about the package laravel-cloudflare-turnstile
A simple package to help integrate Cloudflare Turnstile.
This packages provides helper for setting up and validating Cloudflare Turnstile CAPTCHA responses.
Installation
You can install the package via Composer:
You should then add the following configuration values to your config/services.php
file:
Visit Cloudflare to create your site key and secret key and add them to your .env
file.
Usage
In your layout file, include the Turnstile scripts using the @turnstileScripts
Blade directive. This should be added to the <head>
of your document.
Once that's done, you can use the <x-turnstile />
component inside of a <form>
to output the appropriate markup with your site key configured.
On the server, use the provided validation rule to validate the CAPTCHA response.
If you don't want to use the macro, you can use the turnstile
extension rule instead.
You can also inject the rule object and pass it to the list of validation rules directly.
Customizing the widget
You can customize the widget by passing attributes to the <x-turnstile />
component.
To learn more about these parameters, refer to the offical documentation.
This package can also integrate seamlessly with Livewire. Upon successful validation, the property specified inside of wire:model
will be updated with the Turnstile token.
Multiple widgets with Livewire
If you're using Livewire and need to have multiple widgets on the page, each widget requires a unique ID.
The id
property must match this RegEx: /^[a-zA-Z_][a-zA-Z0-9_]*$/
. IDs that do not match the RegEx will trigger an exception.
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
- Ryan Chandler
- All contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-cloudflare-turnstile with dependencies
spatie/laravel-package-tools Version ^1.13.0
illuminate/contracts Version ^11.0|^12.0