public static function instance() { if (!Captcha::$singleton) { self::$config = Config::get('captcha::config'); self::$assets = __DIR__ . '/../../../public/assets/'; self::$fonts = self::assets('fonts'); self::$backgrounds = self::assets('backgrounds'); Captcha::$singleton = new Captcha(); } return Captcha::$singleton; }
/** * * * @param null $config * @return string * @static */ public static function img($config = null) { return \Mews\Captcha\Captcha::img($config); }
/** * get CAPTCHA * * @param \Mews\Captcha\Captcha $captcha * @param string $config * @return ImageManager->response */ public function getCaptcha(Captcha $captcha, $config = 'default') { return $captcha->create($config); }
/** * Register the service provider. * * @return void */ public function register() { $this->app['captcha'] = $this->app->share(function ($app) { return Captcha::instance(); }); }
public function validateCaptcha($attribute, $value, $parameters) { return \Captcha::check($value); }