jhonoryza/recaptcha-v3

google recaptcha v3

1.0.0 2024-06-21 06:55 UTC

This package is auto-updated.

Last update: 2024-11-25 04:25:49 UTC


README

Total Downloads Latest Stable Version License

This package just provide backend validation rule for google recaptcha v3

Features

  • Lightweight
  • Simple & easy to use
  • Support Laravel version >= 10
  • Recaptcha validation rules

Installation

composer require jhonoryza/recaptcha-v3

publish config file

php artisan vendor:publish --tag=recaptcha-v3-config

Usage

add Recaptcha rule to validation

<?php

use Illuminate\Http\Request
use Jhonoryza\RecaptchaV3\Recaptcha;

public function store(Request $request) {
 
    $request()->validate([
     'email' => ['required', 'max:100','email'],
     'password' => ['required', 'max:100'],
     'captcha_token'  => [new Recaptcha],
    ])

}

update .env file, add you own recaptcha from here

GOOGLE_RECAPTCHA_SITE_KEY=
GOOGLE_RECAPTCHA_SECRET_SITE_KEY=
GOOGLE_RECAPTCHA_MIN_SCORE=0.5
GOOGLE_RECAPTCHA_URL="https://www.google.com/recaptcha/api/siteverify"

Security

If you've found a bug regarding security please mail jardik.oryza@gmail.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.