Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Service Proxy

Service Proxy Laravel Package

openclassrooms/service-proxy

A lightweight Laravel/PHP service proxy from OpenClassrooms that sits between your application and its services, centralizing calls behind a clean, testable interface so business logic stays decoupled from transport details. Useful for wrapping external APIs or internal service layers.

View on GitHub
Deep Wiki
Context7

openclassrooms/service-proxy is a lightweight PHP package that generates proxy classes around your service contracts, letting you defer instantiation and centralize cross-cutting concerns without touching the underlying implementations. It integrates with Laravel's service container, so proxied services resolve lazily and remain swappable through the usual bindings.

  • Generates proxy objects from existing service classes or interfaces
  • Resolves targets lazily via the Laravel container
  • Keeps method signatures and return types intact
  • Provides a clean seam for logging, caching, or instrumentation
  • Ships with a simple, framework-friendly API
Frequently asked questions about Service Proxy
What is openclassrooms/service-proxy used for?
It is a thin abstraction layer that sits between your application or domain code and outbound third-party service calls, exposing a stable contract while hiding the concrete client behind Laravel's container. That makes it easier to decorate, mock, or swap implementations without touching the calling code. It is aimed at codebases that already use interface-driven service layers and need swappable clients for provider migrations, test doubles, or per-environment stubs. In a CRUD-heavy app with few external calls, the extra indirection usually buys little.
How do I install openclassrooms/service-proxy with Composer?
It is a Composer-installable, MIT-licensed package, so you add it as a normal dependency and register its service provider, either through Laravel auto-discovery or manually in your providers list. Because the package is low-ceremony to wire up, a spike takes very little time. Before pinning anything, confirm the package is actually published on Packagist and check the real version tags, since the reported last-release date looks unusual and should be verified as a genuine tag. Pin an exact version rather than a floating constraint.
Which Laravel and PHP versions does openclassrooms/service-proxy support?
The overview does not publish a compatibility matrix, so you should read the composer.json constraints for PHP and illuminate/* before assuming support. A Laravel 9 to 11 fit is plausible if those constraints allow it, but this needs to be confirmed against real tags rather than assumed. Validate installation under the same PHP version matrix you run in production, not just your default developer image. Running composer why and composer outdated in CI will surface constraint drift early.
Does openclassrooms/service-proxy handle HTTP transport, retries, and timeouts?
That is the most important open question about this package, and the name alone does not answer it. It may only resolve and delegate to a client you supply, or it may own transport through Guzzle, Laravel's HTTP client, or PSR-18 — those are very different risk profiles. Read the source to determine whether it swallows exceptions or normalizes failures, since proxy layers commonly degrade tracing and error semantics. If it owns retries and timeouts, those behaviours must be documented and tested before production use.
Is openclassrooms/service-proxy safe to use in production?
It is reasonable for a spike, but committing to it as a load-bearing dependency carries risk: it has zero stars, zero dependents, and a single-vendor origin, so you would be the first meaningful adopter. Single-vendor open-source libraries are often maintained only as long as the vendor's internal need persists. If you adopt it, do so behind a feature flag in one bounded context, keep your existing direct client bound to the same contract as a fallback, and have a fork plan. That way rollback is a config change rather than a revert.
Is openclassrooms/service-proxy compatible with Laravel Octane and queued jobs?
This needs explicit verification before you rely on it. Container-resolved proxies that hold internal state can leak between requests under Swoole or Octane workers, which is a classic failure mode for this kind of layer. Check whether the resolved proxy is stateless and whether it is registered as a singleton or a fresh binding. Test it under Octane and inside a queued job, not only in a standard HTTP request.
How do I test code that uses openclassrooms/service-proxy?
The main benefit of a contract-based proxy is that you can bind a test double or stub implementation in the container and exercise your application code without hitting the real service. Because the concrete client is hidden behind the container, tests assert against your contract rather than the vendor client. Check whether the package ships published tests and CI configuration you can run locally, since that tells you how much confidence to place in the abstraction itself. Also confirm the layer does not swallow exceptions, or your failure-path tests will pass for the wrong reasons.
What are the alternatives to openclassrooms/service-proxy?
For most Laravel applications, a hand-written interface plus a container binding gives you the same swappability with no third-party dependency. Laravel's HTTP client with fakes covers testing and retries, and PSR-18 or Guzzle clients cover transport. If you want a package, look for one with active dependents and a clear compatibility matrix. The contract you write yourself remains valuable even if you later swap the underlying library.
Is openclassrooms/service-proxy still maintained?
There is no stated support commitment or deprecation policy in what has been published, and with no dependents there is no community pressure to keep it current with new Laravel and PHP releases. The reported last-release date of 2026-07-10 is future-dated relative to a normal cadence, so verify it is a real tag rather than a metadata or repository artifact. Check the commit history, issue activity, and who maintains it before depending on it. If you adopt it, budget for owning a fork.
How do I migrate an existing service client to the service proxy pattern?
Do not rip out existing clients. Introduce the proxy behind a feature flag in a single bounded context, wrapping one low-risk external service such as a non-critical enrichment or notification provider. Keep the current direct client bound to the same contract so rollback is a configuration change. Once the contract is proven, expand scope gradually and watch for hidden coupling, especially if the abstraction encodes the vendor's internal service conventions.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections