예제 #1
0
 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;
 }
예제 #2
0
 /**
  * 
  *
  * @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);
 }
예제 #4
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app['captcha'] = $this->app->share(function ($app) {
         return Captcha::instance();
     });
 }
예제 #5
0
 public function validateCaptcha($attribute, $value, $parameters)
 {
     return \Captcha::check($value);
 }