@php
$captcha = config('settings.security.captcha');
$isSimpleCaptchaEnabled = (
in_array($captcha, ['default', 'math', 'flat', 'mini', 'inverse', 'custom'])
&& !empty(config('captcha.option'))
);
$hideClass = 'd-none';
@endphp
@if ($isSimpleCaptchaEnabled)
@php
$prefix = isAdminPanel() ? config('larapen.admin.route', 'admin') . '/' : '';
$captchaUrl = captcha_src(config('settings.security.captcha'));
$captchaReloadUrl = url($prefix . 'captcha/' . config('settings.security.captcha'));
$blankImage = url('images/blank.gif');
$captchaImage = '
';
$captchaHint = '
' . t('captcha_hint') . '
';
$captchaWidth = config('captcha.' . config('settings.security.captcha') . '.width', 150);
$styleCss = ' style="width: ' . $captchaWidth . 'px;"';
$captchaReloadBtn = '';
$captchaReloadBtn .= '';
$captchaReloadBtn .= '';
// DEBUG
// The generated key need to be un-hashed before to be stored in session
// dump(session('captcha.key'));
@endphp
@if (isAdminPanel())
@php
$captchaDivError = (isset($errors) && $errors->has('captcha')) ? ' has-danger' : '';
$captchaError = (isset($errors) && $errors->has('captcha')) ? ' form-control-danger' : '';
$captchaField = '';
@endphp
@else
@php
$captchaError = (isset($errors) && $errors->has('captcha')) ? ' is-invalid' : '';
$captchaField = '';
@endphp
@if (isset($colLeft) && isset($colRight))
{!! $captchaReloadBtn !!}
{!! $captchaHint !!}
{!! $captchaField !!}
@else
@if (isset($label) && $label == true)
{!! $captchaReloadBtn !!}
{!! $captchaHint !!}
{!! $captchaField !!}
@elseif (isset($noLabel) && $noLabel == true)
{!! $captchaReloadBtn !!}
{!! $captchaHint !!}
{!! $captchaField !!}
@else
{!! $captchaReloadBtn !!}
{!! $captchaHint !!}
{!! $captchaField !!}
@endif
@endif
@endif
@endif
@section('captcha_head')
@endsection
@section('captcha_footer')
@if ($isSimpleCaptchaEnabled)
@php
$captchaDelay = (int)config('settings.security.captcha_delay', 1000);
@endphp
@endif
@endsection