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

TSDeveloper's avatar

Path contents missing with Request object using Herd

When using Herd with a generic PHP project, the path properties of the Request object are not getting filled.

$request = new Request;

$step = $request->segment(1);

When I call /setup/validate, nothing is getting filled and the segments are all empty (I did a var dump on it)...in fact most of the request object isn't filled.

I'm new to Herd and want to use it instead of Docker.

Any help would be appreciated!!

Thanks!

0 likes
8 replies
puklipo's avatar

Normally, Herd is used for Laravel.
Beginners shouldn't try something difficult right away.

No one can answer a question without knowing what a "Request" is.

No one writes new Request in Laravel.

TSDeveloper's avatar

@puklipo

That was a completely useless reply.

The fact that you don’t know what a “Request” object is in the context of a web application strongly suggests that you’re probably the beginner.

I’ve found tons of examples with “new Request”.

Don’t worry, though. This “beginner” with over 40 years of SW experience wrote a LocalValetDriver and fixed the problem on his own.

You should stick to replying to posts that you have an actual constructive answer to.

jlrdw's avatar

I suggest just setting up a regular apache or nginx server.

TSDeveloper's avatar

@jlrdw that kind of defeats the purpose of using Herd.

Adding a LocalValetDriver fixed the problem.

Tray2's avatar

Have you tried just dumping the request super global?

$_REQUEST

TSDeveloper's avatar

@jlrdww yes I did…it was empty except for the Session ID.

I fixed the problem by setting up a LocalValetDriver.

Tray2's avatar

@TSDeveloper I did a test, and the request is empty unless you send something in it, but the server super global isn't.

And that is quite normal

martyyy's avatar

I have the exactly same problem, also the PUT requests cannot be send,

What is the purpose of Laravel Herd then when it make you more problems ?!??!!?

Please or to participate in this conversation.