사용할 captcha 객체를 제공해 줌. ### app binding : xe.captcha 로 바인딩 되어 있음 ### Usage * front 에 작성 html
render(); ?>
* 검증 처리 php if (app('xe.captcha')->verify() === true) { 성공 처리 코드 } else { $errors = app('xe.captcha')->errors(); }
Author: XE Developers (developers@xpressengine.com)
Inheritance: extends Illuminate\Support\Manager
 public function testGetAndSetDefaultDriver()
 {
     list($app, $config) = $this->getMocks();
     $instance = new CaptchaManager($app);
     $app->shouldReceive('offsetGet')->with('config')->andReturn($config);
     //        $app->shouldReceive('offsetSet');
     $this->assertEquals('google', $instance->getDefaultDriver());
     $instance->setDefaultDriver('another');
     $this->assertEquals('another', $instance->getDefaultDriver());
 }
Example #2
0
 /**
  * Rendered current object
  *
  * @return string
  */
 public function render()
 {
     $driver = isset($this->arguments['driver']) ? $this->arguments['driver'] : static::$manager->getDefaultDriver();
     $this->template = static::$manager->driver($driver)->render();
     return parent::render();
 }
 /**
  * update Join setting
  *
  * @param CaptchaManager $captcha
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function updateJoin(CaptchaManager $captcha)
 {
     $inputs = Input::except('_token');
     $config = app('xe.config')->get('user.join');
     if ($inputs['useCaptcha'] === 'true' && !$captcha->available()) {
         throw new ConfigurationNotExistsException();
     }
     foreach ($inputs as $key => $val) {
         $config->set($key, $val);
     }
     app('xe.config')->modify($config);
     return redirect()->back()->with('alert', ['type' => 'success', 'message' => '저장되었습니다.']);
 }