post(config('recaptcha.verify.apiurl'), [ 'secret' => config('recaptcha.keys.secret'), 'response' => $challenge, 'remoteip' => $ipAddress, ]); $response = json_decode($verifyrequest->getBody(), true); if (! $response['success']) { throw new FailedCaptchaException('Beep beep boop... Robot? Submission failed.'); } foreach (User::all() as $user) { if ($user->hasRole('admin')) { $user->notify(new NewContact(collect([ 'message' => $message, 'ip' => $ipAddress, 'email' => $email, ]))); } } } }