boson-php/http-contracts
Lightweight PHP contracts for HTTP clients, requests, responses, and middleware. Provides stable interfaces to decouple your app from конкрет implementations, making it easier to swap HTTP libraries, mock in tests, and share consistent types across packages.
Adopt if:
Look elsewhere if:
For Executives: "This package lets us define and enforce API contracts in PHP—like a ‘schema for dummies’—without bloating our stack with OpenAPI tools. It’s lightweight, MIT-licensed, and could cut debugging time by 30% by catching invalid requests early. Ideal for our Laravel microservices roadmap, with minimal dev overhead."
For Engineering: *"boson-php/http-contracts gives us a PSR-compliant way to validate HTTP requests/responses using PHP classes (no JSON Schema YAML). Perfect for:
if ($request->has(...)) checks with typed contracts.For Developers:
*"Imagine Request classes that automatically reject bad data—like TypeScript for HTTP. Example:
class CreateUserRequest {
public function rules(): array {
return [
'name' => 'string|min:3',
'email' => 'email|required',
];
}
}
No more try-catch for malformed payloads. Tradeoff: Less ‘batteries-included’ than OpenAPI, but more control."*
How can I help you explore Laravel packages today?