Skip to content

Adds ClientOptions for API configuration - #61

Merged
SergkeiM merged 1 commit into
masterfrom
feature/reliability-pass
Aug 14, 2026
Merged

SergkeiM merged 1 commit into
masterfrom
feature/reliability-pass

Conversation

@SergkeiM

Copy link
Copy Markdown
Owner

Introduces a dedicated ClientOptions class to centralize and formalize the configuration of the underlying HTTP client (Guzzle).

This change enhances the client's reliability and flexibility by:

  • Enabling explicit control over base URL, request timeouts, connection timeouts, and custom headers.
  • Providing a type-safe and validated mechanism for defining client behavior, including Guzzle middlewares.
  • Improving integration with Laravel applications by allowing these options to be driven from .env files.
  • Facilitating testing by allowing the base URL to be pointed at mock servers.

The Client and HttpClient constructors are updated to accept a ClientOptions instance, and the Laravel service provider now builds this instance from the application's configuration. Comprehensive documentation and tests are included for the new configuration capabilities.

This change centralizes all HTTP client transport settings—including base URL, timeouts, headers, and Guzzle middlewares—into a new `ClientOptions` object.

This provides a more explicit, type-safe, and flexible way to configure the client. The Laravel service provider now utilizes these options, enabling full configuration via environment variables and the `cloudflare.php` config file. Comprehensive documentation and tests are included.
@SergkeiM
SergkeiM merged commit 23bdfa1 into master Aug 14, 2026
8 checks passed
@SergkeiM
SergkeiM deleted the feature/reliability-pass branch August 14, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant