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

Flipity's avatar

Best approach for calling JSON RPC API?

There is a running JSON RPC server on the same machine of the Laravel project. I need to get information via an API it provides on port 3333. (localhost)

What is the best way to call that API with Laravel?

Ty

0 likes
4 replies
Flipity's avatar

@martinbean thank you. You mean the built-in Laravel's HTTP client?

The docs are really concise about it: Where do I place the relevant code for these requests for example?

martinbean's avatar

@Flipity You’re not really giving much to go on.

Where do I place the relevant code for these requests for example?

Where ever you want to call your JSON API. A controller. An Artisan command. A queued job.

1 like
Flipity's avatar

@martinbean Thank you, I think it's the Controller in my case. Just wasn't sure if that's an appropriate location or there's a special folder for this one.

Please or to participate in this conversation.