Let’s look at how we send a payload to a REST API.
Option 1: The Raw JSON (How the API actually works)
Send this payload:
{
"someField": "text",
"someOtherField": {
"firstProperty": "text",
"secondProperty": "text"
}
}
…to the endpoint, with headers, and get the response.
Option 2: The OOP Client SDK (The “Standard”)
$payload = new Payload();
$payload->setSomeField('text');
$someOtherField = new SomeOtherField();
$someOtherField->setFirstProperty('text');
$someOtherField->setSecondProperty('text');
$payload->setSomeOtherField($someOtherField);
return (new CustomClient())->send($payload);
Under the hood, this bloated code just translates back to the exact same JSON from Option 1 anyway. Developers defend this by pointing to type safety and IDE autocomplete, but that completely ignores the actual integration workflow.
If you use a strict OOP client SDK , your workflow looks like this:
- Read through the API documentation.
- Understand the required fields.
- Understand the required JSON structure.
- Reverse-engineer the client SDK vendor code to find which arbitrarily named classes and setters build that exact JSON.
- Send the request.
Why are we accepting Step 4 as standard practice? For the classic array or raw JSON option, you skip Step 4 entirely. You already know the payload structure from the docs; translating it into objects is wasted time.
This is exactly why Maravel-Rest-Wizard-Client and Laravel-Crud-Wizard-Client-Free also offer the setRawRequest method:
public function setRawRequest(array $request): self
It gives you the architectural benefits of a structured client, but lets you bypass the OOP overhead the second it becomes a bottleneck.
To be clear: OOP abstraction has its place. It is incredibly powerful when it hides complex, dynamic logic — like how Eloquent abstracts raw SQL queries or MaravelQL abstracts raw requests so you don’t have to write them manually.
But modern HTTP SDKs aren’t doing that. They aren’t abstracting complex logic; they are just forcing you to write a 1:1 OOP mirror of a static JSON payload. When you are forced to learn the API documentation anyway, that OOP layer doesn’t help you code faster — it just wastes your time.

Top comments (0)