First Commit

This commit is contained in:
marco
2026-09-01 07:49:48 -03:00
commit 28b1044038
399 changed files with 41659 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App\Http\Validation;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Support\Facades\Session;
class MathCaptchaRule implements Rule
{
public function passes($attribute, $value): bool
{
if (!Session::has('math_captcha_answer')) {
return false;
}
$expected = Session::get('math_captcha_answer');
Session::forget('math_captcha_answer');
Session::forget('math_captcha_question');
return $value !== null && $value !== '' && (int) $value === (int) $expected;
}
public function message(): string
{
return __('The captcha answer is incorrect. Please try again.');
}
}