Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Google Captcha Bundle Laravel Package

backend2-plus/google-captcha-bundle

View on GitHub
Deep Wiki
Context7

Google Captcha Bundle

Simple Symfony bundle for Google reCAPTCHA integration.

Installation

composer require sasa1007/google-captcha-bundle

Note: After installation, you need to manually configure the bundle as described below.

Configuration

Create configuration file config/packages/google_captcha.yaml:

google_captcha:
    secret: '%env(GOOGLE_CAPTCHA_SECRET)%'

Add to your .env file:

GOOGLE_CAPTCHA_SECRET=your_google_recaptcha_secret_key

Note: Replace your_google_recaptcha_secret_key with your actual Google reCAPTCHA secret key from Google reCAPTCHA Admin Console.

Usage

use BeckUp\GoogleCaptchaBundle\Service\GoogleCaptchaService;

class YourController extends AbstractController
{
    public function someAction(Request $request, GoogleCaptchaService $captchaService)
    {
        $result = $captchaService->verify($request);
        
        if ($result->success) {
            // reCAPTCHA passed
        } else {
            // reCAPTCHA failed
        }
    }
}

Frontend

Add Google reCAPTCHA script to your template:

<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<div class="g-recaptcha" data-sitekey="your_site_key"></div>

Uninstallation

To remove the bundle:

  1. Delete configuration file:
rm config/packages/google_captcha.yaml
  1. Remove from composer:
composer remove sasa1007/google-captcha-bundle

Note: The bundle is automatically unregistered and service definitions are removed when you uninstall the package.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky