diff --git a/src/Recaptcha.php b/src/Recaptcha.php index d4824bb..a30f480 100644 --- a/src/Recaptcha.php +++ b/src/Recaptcha.php @@ -17,6 +17,29 @@ public function __construct($service, $config) $this->service = $service; $this->config = $config; } + + /** + * View render + * + * @param $parameter + * @return \Greggilbert\Recaptcha\view + */ + public function instantRender($parameter) + { + $options = []; + + if (is_string($parameter)) { + $this->config['public_key'] = $parameter; + } + + if (!empty($parameter['public_key'])) { + $this->config['public_key'] = $parameter['public_key']; + $options = $parameter; + } + + // Array + return $this->render($options); + } /** * Render the recaptcha