🆙 Add cms i using 🆙

This commit is contained in:
Remco
2025-11-25 22:42:56 +01:00
parent 94704e0925
commit d44196149e
35591 changed files with 3601123 additions and 0 deletions
@@ -0,0 +1,12 @@
<?php
return [
'missing-input-secret' => 'لم يتم إرسال البيانات اللازمة للتحقق من Captcha.',
'invalid-input-secret' => 'البيانات اللازمة للتحقق من Captcha غير صحيحة أو غير موجودة.',
'missing-input-response' => 'لم يتم إرسال الرد المطلوب للتحقق من Captcha.',
'invalid-input-response' => 'الرد المطلوب للتحقق من Captcha غير صالح أو انتهت صلاحيته.',
'bad-request' => 'تم رفض الطلب لأنه غير مكتمل أو يحتوي على خطأ.',
'timeout-or-duplicate' => 'تم استخدام رد Captcha هذا مسبقًا.',
'internal-error' => 'حدث خطأ داخلي أثناء التحقق من Captcha.',
'unexpected' => 'حدث خطأ غير متوقع أثناء التحقق من Captcha.',
];
@@ -0,0 +1,12 @@
<?php
return [
'missing-input-secret' => 'The secret parameter was not passed.',
'invalid-input-secret' => 'The secret parameter was invalid or did not exist.',
'missing-input-response' => 'The response parameter was not passed.',
'invalid-input-response' => 'The response parameter is invalid or has expired.',
'bad-request' => 'The request was rejected because it was malformed.',
'timeout-or-duplicate' => 'The response parameter has already been validated before.',
'internal-error' => 'An internal error happened while validating the response.',
'unexpected' => 'An unexpected error occurred.',
];
@@ -0,0 +1 @@
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer {{ $attributes }}></script>
@@ -0,0 +1,45 @@
@props([
'id' => 'captcha',
])
@php
if (! preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $id)) {
throw new InvalidArgumentException("The Turnstile ID [{$id}] must start start with a letter or underscore, and can only contain alphanumeric or underscore characters.");
}
$model = $attributes->has('wire:model') ? $attributes->get('wire:model') : null;
@endphp
<div
data-sitekey="{{ config('services.turnstile.key') }}"
@if ($model)
wire:ignore
data-callback="{{ $id }}Callback"
data-expired-callback="{{ $id }}ExpiredCallback"
data-timeout-callback="{{ $id }}ExpiredCallback"
{{ $attributes->filter(fn($value, $key) => ! in_array($key, ['data-callback', 'data-expired-callback', 'data-timeout-callback', 'wire:model', 'id']))->class(['cf-turnstile']) }}
@else
{{ $attributes->class(['cf-turnstile']) }}
@endif
></div>
@if ($model)
<script>
document.addEventListener('livewire:initialized', () => {
window.{{ $id }}Callback = function (token) {
@this.set("{{ $model }}", token);
}
window.{{ $id }}ExpiredCallback = function () {
window.turnstile.reset();
}
@this.watch("{{ $model }}", (value, old) => {
// If there was a value, and now there isn't, reset the Turnstile.
if (!!old && !value) {
window.turnstile.reset();
}
})
});
</script>
@endif