🤖 This repository contains simple reCAPTCHA v3 integration for your Laravel application.
MIT License
This repository contains simple reCAPTCHA v3 integration for your Laravel application.
You can install the package via composer:
composer require torralbodavid/simple-recaptcha-v3
Override xxxxx with your reCaptcha v3 keys. Get yours here
CAPTCHA_SITE_KEY=xxxxx
CAPTCHA_SECRET_KEY=xxxxx
Optionally, you can publish the config file of the package. You will be able to customize advanced settings, such as:
php artisan vendor:publish --provider="Torralbodavid\SimpleRecaptchaV3\SimpleRecaptchaV3ServiceProvider" --tag=config
@captcha_init
blade directive. This will start loading Google reCAPTCHA API. <html>
<head>
...
@captcha_init
</head>
</html>
@captcha('xxxx')
blade directive. Replace xxxx with your desired action. <form method="..." action="...">
@captcha('login')
...
</form>
'recaptcha_response' => new Captcha
use Torralbodavid\SimpleRecaptchaV3\Rules\Captcha;
...
$request->validate([
...
'recaptcha_response' => new Captcha,
]);
You can customize reCaptcha v3 error messages by publishing the translations on your project.
php artisan vendor:publish --provider="Torralbodavid\SimpleRecaptchaV3\SimpleRecaptchaV3ServiceProvider" --tag=lang
You can customize @captcha and @captcha_init snippets by publishing the views on your project
php artisan vendor:publish --provider="Torralbodavid\SimpleRecaptchaV3\SimpleRecaptchaV3ServiceProvider" --tag=views
You can easily disable reCaptcha v3 integration in your tests by adding the following configuration on them
config()->set('simple-recaptcha-v3.active', false);
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
Have fun!