Made it possible to disable captcha.
This commit is contained in:
parent
a5e3c5ed25
commit
8bc4c0d8d0
@ -5,6 +5,7 @@ APP_DEBUG=true
|
|||||||
APP_TIMEZONE=UTC
|
APP_TIMEZONE=UTC
|
||||||
APP_URL=http://localhost
|
APP_URL=http://localhost
|
||||||
|
|
||||||
|
APP_CAPTCHA=false
|
||||||
CAPTCHA_API_DOMAIN=http://your-domain-captcha-or-IP:8081
|
CAPTCHA_API_DOMAIN=http://your-domain-captcha-or-IP:8081
|
||||||
CAPTCHA_PRIVATE_TOKEN=
|
CAPTCHA_PRIVATE_TOKEN=
|
||||||
CAPTCHA_STATIC_PATH=http://your-domain-captcha-or-IP:8081/captcha
|
CAPTCHA_STATIC_PATH=http://your-domain-captcha-or-IP:8081/captcha
|
||||||
|
@ -19,7 +19,9 @@ public function __construct(
|
|||||||
|
|
||||||
public function login(): View
|
public function login(): View
|
||||||
{
|
{
|
||||||
return view('login');
|
return view('login', [
|
||||||
|
'captcha' => config('app.captcha', false),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function authorization(AuthorizationRequest $request): RedirectResponse
|
public function authorization(AuthorizationRequest $request): RedirectResponse
|
||||||
|
@ -13,12 +13,17 @@ final class AuthorizationRequest extends FormRequest implements FormRequestDto
|
|||||||
*/
|
*/
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
$rules = [
|
||||||
'email' => ['required', 'email', 'max:255'],
|
'email' => ['required', 'email', 'max:255'],
|
||||||
'password' => ['required', 'min:3'],
|
'password' => ['required', 'min:3'],
|
||||||
'captcha-verified' => ['captcha'],
|
|
||||||
'remember' => ['nullable', 'boolean'],
|
'remember' => ['nullable', 'boolean'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (config('app.captcha', false)) {
|
||||||
|
$rules['captcha-verified'] = ['captcha'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDto(): Authorization
|
public function getDto(): Authorization
|
||||||
|
@ -32,12 +32,17 @@ public function attributes(): array
|
|||||||
*/
|
*/
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
$rules = [
|
||||||
'name' => ['nullable', 'string', 'max:255'],
|
'name' => ['nullable', 'string', 'max:255'],
|
||||||
'email' => ['nullable', 'string', 'max:255', 'email'],
|
'email' => ['nullable', 'string', 'max:255', 'email'],
|
||||||
'message' => ['required', 'string', 'max:5000'],
|
'message' => ['required', 'string', 'max:5000'],
|
||||||
'captcha-verified' => ['captcha'],
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (config('app.captcha', false)) {
|
||||||
|
$rules['captcha-verified'] = ['captcha'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDto(): Send
|
public function getDto(): Send
|
||||||
|
@ -28,6 +28,15 @@
|
|||||||
|
|
||||||
'env' => env('APP_ENV', 'production'),
|
'env' => env('APP_ENV', 'production'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Сaptcha
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Enables or disables captcha.
|
||||||
|
*/
|
||||||
|
'captcha' => (bool) env('APP_CAPTCHA', false),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Application Debug Mode
|
| Application Debug Mode
|
||||||
|
@ -49,9 +49,11 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@if($captcha)
|
||||||
<div class="form-group mb-4">
|
<div class="form-group mb-4">
|
||||||
@captcha
|
@captcha
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div class="d-grid">
|
<div class="d-grid">
|
||||||
<button type="submit" class="btn btn-gray-800">{{ __('Sign in') }}</button>
|
<button type="submit" class="btn btn-gray-800">{{ __('Sign in') }}</button>
|
||||||
|
@ -8,12 +8,14 @@
|
|||||||
<x-site.forms.input :title="$websiteTranslations->translate('site.attributes.name')" :websiteTranslations="$websiteTranslations" name="name" type="text" value="" autofocus />
|
<x-site.forms.input :title="$websiteTranslations->translate('site.attributes.name')" :websiteTranslations="$websiteTranslations" name="name" type="text" value="" autofocus />
|
||||||
<x-site.forms.input :title="$websiteTranslations->translate('site.attributes.email')" :websiteTranslations="$websiteTranslations" name="email" type="text" value="" />
|
<x-site.forms.input :title="$websiteTranslations->translate('site.attributes.email')" :websiteTranslations="$websiteTranslations" name="email" type="text" value="" />
|
||||||
<x-site.forms.textarea-wysiwyg :title="$websiteTranslations->translate('site.attributes.message')" :websiteTranslations="$websiteTranslations" required name="message" value="" />
|
<x-site.forms.textarea-wysiwyg :title="$websiteTranslations->translate('site.attributes.message')" :websiteTranslations="$websiteTranslations" required name="message" value="" />
|
||||||
|
@if($captcha)
|
||||||
<div class="form-block">
|
<div class="form-block">
|
||||||
@captcha
|
@captcha
|
||||||
@error('captcha-verified')
|
@error('captcha-verified')
|
||||||
<span class="invalid-feedback">{{ $message }}</span>
|
<span class="invalid-feedback">{{ $message }}</span>
|
||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
<div class="form-block">
|
<div class="form-block">
|
||||||
<button class="button" type="submit">{{ $websiteTranslations->translate('site.Feedback-send') }}</button>
|
<button class="button" type="submit">{{ $websiteTranslations->translate('site.Feedback-send') }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user