$answer]); return [ 'question' => "What is {$num1} + {$num2}?", 'question_ar' => "ما هو {$num1} + {$num2}؟", ]; } /** * Validate the user's captcha answer. */ public function validate(mixed $answer): bool { $expected = session(self::SESSION_KEY); if (is_null($expected)) { return false; } return (int) $answer === (int) $expected; } /** * Clear the current captcha from session. */ public function clear(): void { session()->forget(self::SESSION_KEY); } }