Laravel Invisible reCAPTCHA Example

Submitted by dave - 7 years ago

Laravel Invisible reCAPTCHA Example – Laravel Validate Form on Submit using Google reCaptcha

// controller for Laravel Invisible reCAPTCHA Example
public function getGoogleCaptchaForm(){
    return view('files.captchaform');
}
public function postGoogleCaptchaForm(Request $request){
    $this->validate($request, [
        // name validate
        'name' => 'required',
        // email validate
        'email'=>'required|email',
        // phone validate
        'phone'=>'required|numeric|digits:11',
        // details validate
        'details' => 'required',
        // recaptcha validate
        'g-recaptcha-response' => 'required|captcha',
  ]);
}

// see more at :: http://www.onlinecode.org/laravel-invisible-recaptcha-v2-example/