diff --git a/src/RecaptchaServiceProvider.php b/src/RecaptchaServiceProvider.php index df0b5f7..bd05941 100644 --- a/src/RecaptchaServiceProvider.php +++ b/src/RecaptchaServiceProvider.php @@ -35,8 +35,8 @@ public function boot() */ public function addValidator() { - $this->app->validator->extendImplicit('recaptcha', function ($attribute, $value, $parameters) { - $captcha = app('recaptcha.service'); + $captcha = app('recaptcha.service'); + $this->app->validator->extendImplicit('recaptcha', function ($attribute, $value, $parameters) use($captcha) { $challenge = app('request')->input($captcha->getResponseKey()); return $captcha->check($challenge, $value);