captcha
captcha copied to clipboard
Add second parameters,I would like to repeat the verification
Add second parameters
if ( ! function_exists('captcha_check')) {
/**
* @param $value
* @return bool
*/
function captcha_check($value , $del = true)
{
return app('captcha')->check($value,$del);
}
}
public function check($value , $del = true)
{
if ( ! $this->session->has('captcha'))
{
return false;
}
$key = $this->session->get('captcha.key');
if ( ! $this->session->get('captcha.sensitive'))
{
$value = $this->str->lower($value);
}
if($del){
$this->session->remove('captcha');
}
return $this->hasher->check($value, $key);
}
What is the purpose of this?
Verify two times. one for ajax, two for php
in Request validation, laravel 5.2 laravel will call check two times, after another attribute validate failed.