Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MohamadSleimanHaidar's avatar

Input Value Different on Server

I'm fetching data through an API. I request the following URL: http://localhost:8000/api/v1/individuals?page=1 and I receive a paginated list of individuals.

I am performing a couple of checks because several controllers could hit that same URL. Namely I'm checking if $request->input('q', '') is empty or null. When working locally, and from the page that I'm accessing it from, q is always empty.

However, when I deploy the code to the server and do the same check from the same page, I'm receiving "/api/v1/individuals" as q. I've been trying to debug for hours and this has got me stumped. Any leads? Thank you.

0 likes
2 replies
JeroenVanOort's avatar

Can you please post the result of $request->input() on both your development and production environment when calling the same URI?

MohamadSleimanHaidar's avatar

Development:

array:1 [
  "page" => "1"
]
Production:
array:2 [
  "q" => "/api/v1/individuals"
  "page" => "1"
]

Query string parameters on both environments: page 1

Something is setting q and I have no idea what it is. I've scoured my forms, both visible and hidden and nothing came up. The only thing that looks like it might lead somewhere is the fact that it seems like this part of the URl: '/api/v1/individuals' is being set as q.

Please or to participate in this conversation.