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

j_watson's avatar

Can laravel API endpoints have parameters?

I'm trying to create an endpoint that allows the client to request for an authorization to the server by sending his/her ID along with the API request. Is this possible?

0 likes
8 replies
sr57's avatar
sr57
Best Answer
Level 39

Till now I use this syntax with Http client

$response = Http::"<my_server>/api/<my_action>?param1=$p1

You can try your syntax and let us know.

sr57's avatar

This syntax is for an api/ GET

for an api/POST your syntax should work

Please or to participate in this conversation.