Turnstile Working Locally But Not On Website

I’m having a problem where Turnstile is working perfectly locally but when I push to my dev server it’s giving me the following error saying I have an invalid input secret:


I’m not quite sure what the issue is. I have both my front end and back end domains listed in the settings in the dashboard and I’m certain that I have the keys correct.

I’m using Laravel/PHP to verify the response and you can see the code below:

    private function checkToken($token)
      $response = Http::asForm()->post('https://challenges.cloudflare.com/turnstile/v0/siteverify', [
                  'secret' => *********,
                  'response' => $token,
      return $response['success'];

I would really appreciate any direction here.