You can install the package via composer:
composer require devwizardhq/wiz-captchaYou can publish the config file with:
php artisan vendor:publish --tag="wiz-captcha-config"<form method="POST" action="/contact">
@csrf
{!! wiz_captcha_img('default', ['id' => 'captcha-image']) !!}
<button type="button" onclick="refreshCaptcha()">Refresh</button>
<input type="text" name="captcha" required autocomplete="off">
@error('captcha')
<div>{{ $message }}</div>
@enderror
<button type="submit">Submit</button>
</form>
<script>
function refreshCaptcha() {
document.getElementById('captcha-image').src = "{{ route('wiz-captcha.image') }}?" + Date.now();
}
</script>use DevWizardHQ\Captcha\Rules\CaptchaRule;
$request->validate([
'captcha' => ['required', new CaptchaRule],
]);$request->validate([
'captcha' => ['required', 'wiz_captcha'],
]);$captcha = wiz_captcha_api('math');use DevWizardHQ\Captcha\Rules\CaptchaApiRule;
$request->validate([
'captcha_key' => ['required', 'string'],
'captcha' => ['required', new CaptchaApiRule($request->captcha_key)],
]);composer testPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.