Desarrollo Web en Entorno Servidor
  • Presentación
  • Introducción
  • Docker en DAW
  • PHP
  • MVC
  • Laravel
    • Laravel 6.*
    • Laravel 8.*
    • Laravel 9.*
    • Trabajo
    • API con Laravel
  • Node.js
    • Instalacion
    • Introduccion
    • Proyecto Hola Usuario
    • Servidor Express
    • Api REST
  • WEB SERVICES
    • Qué son?
    • REST
    • OAuth
  • Un paso más allá
    • OAuth con Google
    • reCAPTCHA
    • Google Calendar
    • API Aemet
Powered by GitBook
On this page

Was this helpful?

  1. Un paso más allá

reCAPTCHA

PreviousOAuth con GoogleNextGoogle Calendar

Last updated 6 years ago

Was this helpful?

  • Usaremos el paquete el cual funciona en todas las veriones de Laravel.

  • Registramos nuestro sitio para usar reCAPTCHA en

  • Instalamos el paquete con composer:

"greggilbert/recaptcha": "dev-master"

  • Accede al enlace de arriba y sigue las intrucciones de GitHub:

    • Registra el paquete en config/app.php

    • Registra el alias

  • Ejecuta php artisan vendor:publish --provider="Greggilbert\Recaptcha\RecaptchaServiceProvider".

  • En /config/recaptcha.php coloca:

    • Tus claves pública y privada.

    • En options, añade 'lang' => 'es',-

  • En el fichero resources/lang/[lang]/validation.php añade el mensaje de error: 'recaptcha' => 'El campo :attribute no es correcto.',

  • Añade el reCAPTCHA a tu vista: {!! Recaptcha::render() !!}

  • Añade la validación a tu controlador:

    'g-recaptcha-response' => 'required|recaptcha',
  • Podemos añadir mensajes de error asociado a este campo especial.

  • Ya podemos usar reCAPTCHA en nuestro formulario.

  • Enlaces de ayuda:

https://github.com/greggilbert/recaptcha
https://www.google.com/recaptcha/admin
https://github.com/greggilbert/recaptcha
https://styde.net/como-integrar-google-recaptcha-en-formularios-de-login-y-registro-de-laravel-5-2/
https://www.google.com/recaptcha/admin#site/337097093?setup