4, // Panjang captcha 'width' => 120, // Lebar captcha 'height' => 36, // Tinggi captcha 'quality' => 90, // Kualitas gambar 'math' => true, // Gunakan operasi matematika, true atau false ]; // Inisialisasi Captcha dengan konfigurasi $captcha = new Captcha($config); // Generate new captcha image $captchaData = $captcha->create(); // Encrypt the captcha code for verification $encryptedCaptcha = Crypt::encryptString($captchaData['sensitive']); // Return the HTML code for the new captcha image return response()->json([ 'captcha' => $captchaData['image_src'], 'encrypted_captcha' => $encryptedCaptcha, ]); } }