getUserAgent(); if (!is_null($userAgent)) { $userAgent = Str::limit($userAgent, 255, ''); } $referer = $httpUserData->getReferer(); if (!is_null($referer)) { $referer = Str::limit($referer, 10000, ''); } return CaptchaLog::create([ 'captcha_id' => $captchaId, 'type' => $captchaLogType, 'ip' => $httpUserData->getClientIp(), 'user_agent' => $userAgent, 'referer' => $referer, ]); } }