add recaptcha to tickets and preview to settings

This commit is contained in:
1day2die 2023-04-30 01:00:45 +02:00
parent fe2020f817
commit bfda91516a
3 changed files with 34 additions and 0 deletions

View file

@ -39,6 +39,7 @@ class TicketsController extends Controller
'ticketcategory' => 'required',
'priority' => 'required',
'message' => 'required',
'g-recaptcha-response' => ['required', 'recaptcha'],
]
);
$ticket = new Ticket(

View file

@ -159,6 +159,28 @@
</div>
</div>
@endforeach
<div class="row">
<div class="col-4 d-flex align-items-center">
<label for="recaptcha_preview">{{__("ReCAPTCHA Preview")}}</label>
</div>
<div class="col-8">
<div class="w-100">
<div class="input-group mb-3">
{!! htmlScriptTagJsApi() !!}
{!! htmlFormSnippet() !!}
@error('g-recaptcha-response')
<span class="text-danger" role="alert">
<small><strong>{{ $message }}</strong></small>
</span>
@enderror
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 d-flex align-items-center justify-content-end">
<button type="submit"

View file

@ -90,6 +90,17 @@
</span>
@endif
</div>
@if (app(App\Settings\GeneralSettings::class)->recaptcha_enabled)
<div class="input-group mb-3">
{!! htmlScriptTagJsApi() !!}
{!! htmlFormSnippet() !!}
@error('g-recaptcha-response')
<span class="text-danger" role="alert">
<small><strong>{{ $message }}</strong></small>
</span>
@enderror
</div>
@endif
</div>
<div class="card-footer">
<button type="submit" class="btn btn-primary ticket-once">