Commit d72a9e65 authored by andkom's avatar andkom

custom guzzle options

parent ebe7673d
...@@ -34,12 +34,13 @@ class NoCaptcha ...@@ -34,12 +34,13 @@ class NoCaptcha
* *
* @param string $secret * @param string $secret
* @param string $sitekey * @param string $sitekey
* @param array $options
*/ */
public function __construct($secret, $sitekey) public function __construct($secret, $sitekey, $options = [])
{ {
$this->secret = $secret; $this->secret = $secret;
$this->sitekey = $sitekey; $this->sitekey = $sitekey;
$this->http = new Client([ 'timeout' => 2.0 ]); $this->http = new Client($options);
} }
/** /**
......
...@@ -55,7 +55,8 @@ class NoCaptchaServiceProvider extends ServiceProvider ...@@ -55,7 +55,8 @@ class NoCaptchaServiceProvider extends ServiceProvider
$this->app->singleton('captcha', function ($app) { $this->app->singleton('captcha', function ($app) {
return new NoCaptcha( return new NoCaptcha(
$app['config']['captcha.secret'], $app['config']['captcha.secret'],
$app['config']['captcha.sitekey'] $app['config']['captcha.sitekey'],
$app['config']['captcha.options']
); );
}); });
} }
......
...@@ -3,4 +3,7 @@ ...@@ -3,4 +3,7 @@
return [ return [
'secret' => env('NOCAPTCHA_SECRET'), 'secret' => env('NOCAPTCHA_SECRET'),
'sitekey' => env('NOCAPTCHA_SITEKEY'), 'sitekey' => env('NOCAPTCHA_SITEKEY'),
'options' => [
'timeout' => 2.0,
],
]; ];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment