for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace Arcanedev\NoCaptcha\Rules;
use Arcanedev\NoCaptcha\Contracts\NoCaptcha;
use Illuminate\Contracts\Validation\Rule;
/**
* Class CaptchaRule
*
* @package Arcanedev\NoCaptcha\Rules
* @author ARCANEDEV <[email protected]>
*/
class CaptchaRule implements Rule
{
/* -----------------------------------------------------------------
| Main methods
| -----------------------------------------------------------------
* Determine if the validation rule passes.
* @param string $attribute
* @param mixed $value
* @return bool
public function passes($attribute, $value)
return app(NoCaptcha::class)->verify($value, request()->ip());
}
* Get the validation error message.
* @return string
public function message()
return trans('validation.captcha');