PHPackages                             echoproxy/sdk-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. echoproxy/sdk-laravel

ActiveLibrary[HTTP &amp; Networking](/categories/http)

echoproxy/sdk-laravel
=====================

Laravel SDK for EchoProxy — captures HTTP traffic and ships it to ingest-api. Server middleware + Guzzle middleware + proxy-mode client.

v0.4.0(2w ago)060↓15.6%MITPHPPHP ^8.1

Since May 11Pushed 2w agoCompare

[ Source](https://github.com/songhieu/echoproxy-sdk-laravel)[ Packagist](https://packagist.org/packages/echoproxy/sdk-laravel)[ Docs](https://github.com/songhieu/EchoProxy)[ RSS](/packages/echoproxy-sdk-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

echoproxy/sdk-laravel
=====================

[](#echoproxysdk-laravel)

Laravel/PHP SDK for the [EchoProxy](../README.md) HTTP observability platform.

Install
-------

[](#install)

```
composer require echoproxy/sdk-laravel
```

```
ECHOPROXY_API_KEY=sk_live_xxx
ECHOPROXY_ENDPOINT=http://localhost:8081
```

Capture inbound requests
------------------------

[](#capture-inbound-requests)

`bootstrap/app.php` (Laravel 11):

```
->withMiddleware(function ($middleware) {
    $middleware->append(\Echoproxy\Sdk\Middleware\CaptureRequests::class);
})
```

`Kernel::$middleware` (Laravel 10):

```
\Echoproxy\Sdk\Middleware\CaptureRequests::class,
```

Capture outbound HTTP — pick a mode
-----------------------------------

[](#capture-outbound-http--pick-a-mode)

There are **two** ways to capture outbound calls. Pick one per project.

Proxy mode (`ProxyClient`)Capture mode (`GuzzleMiddleware`)Who calls the upstream**proxy-gateway** (Go)**your app** (Guzzle)Where the event is emittedproxy-gateway → KafkaSDK → ingest-api → KafkaLatency added~1 hop to proxy-gateway~µs (event buffered + flushed at request shutdown)`upstream_latency_ms`measured server-side via `httptrace` (authoritative)measured via Guzzle `on_stats` → `TransferStats::getTransferTime()``upstream_ttfb_ms`yes, real TTFByes when cURL handler is used (`starttransfer_time`); else 0Body capture capenforced in proxy-gatewayenforced in SDKCode changeswap `Http::*` for `ProxyClient::*`wire one Guzzle handler-stack pushDashboard `source``proxy-gateway``sdk-laravel`Dashboard mode badge**proxy****capture**### When to use which

[](#when-to-use-which)

- **Proxy mode** — the default. Use whenever your app can reach `proxy-gateway:8080`. You get the most accurate timing (TTFB, upstream RoundTrip, proxy overhead) and don't have to manage buffer/flush.
- **Capture mode** — use when (a) your runtime can't reach the proxy, (b) you have many existing call-sites using Guzzle directly (lots of vendor SDKs do — Stripe, AWS, etc.) and don't want to refactor, or (c) you need per-call programmatic context (custom redaction, sample rate) that the proxy can't see.

### Proxy mode — drop-in for `Http::*`

[](#proxy-mode--drop-in-for-http)

```
use Echoproxy\Sdk\ProxyClient;

$client = app(ProxyClient::class); // bound by EchoproxyServiceProvider

$res = $client->get('https://api.openai.com/v1/models');
$res = $client->post('https://api.stripe.com/v1/charges', ['amount' => 1000]);
```

### Capture mode — Guzzle handler stack

[](#capture-mode--guzzle-handler-stack)

```
use GuzzleHttp\Client as Guzzle;
use GuzzleHttp\HandlerStack;
use Echoproxy\Sdk\Client;
use Echoproxy\Sdk\Http\GuzzleMiddleware;

$stack = HandlerStack::create();
$stack->push(GuzzleMiddleware::create(app(Client::class)));
$guzzle = new Guzzle(['handler' => $stack]);
```

Works with any library that accepts a Guzzle `HandlerStack`. The middleware uses Guzzle's `on_stats` to measure transport time separately from PHP overhead — chains any caller-supplied `on_stats`, so it composes safely.

Redaction
---------

[](#redaction)

The SDK ships with the same defense-in-depth scrub list as the Go reference:

- `Authorization`, `Cookie`, `X-Api-Key`, `X-Auth-Token`, `X-CSRF-Token`, …
- JSON fields: `password`, `token`, `secret`, `api_key`, `credit_card`, …
- Patterns: JWT, Bearer, AWS keys, Stripe, GitHub, Google API, Slack, Luhn-validated cards.

Extend in `config/echoproxy.php`:

```
'redact' => [
    'extra_headers' => ['X-Customer-Email'],
    'extra_json_fields' => ['account_number'],
],
```

`ingest-api` re-applies the same rules server-side, so misconfiguration here is not a wire-leak risk.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance96

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

2

Last Release

20d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/809466aae265feadc836328793bfc3349386454d0699b9e0bfa357cd825d8165?d=identicon)[songhieu](/maintainers/songhieu)

---

Top Contributors

[![songhieu](https://avatars.githubusercontent.com/u/9289208?v=4)](https://github.com/songhieu "songhieu (3 commits)")

---

Tags

httplaravelloggingproxyGuzzleapmobservabilityechoproxy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/echoproxy-sdk-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/echoproxy-sdk-laravel/health.svg)](https://phpackages.com/packages/echoproxy-sdk-laravel)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k532.1M2.5k](/packages/aws-aws-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[neuron-core/neuron-ai

The PHP Agentic Framework.

1.9k496.1k32](/packages/neuron-core-neuron-ai)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M506](/packages/shopware-core)[mimmi20/browser-detector

Library to detect Browsers and Devices

48156.1k4](/packages/mimmi20-browser-detector)[eliashaeussler/cache-warmup

Composer package to warm up website caches, based on a given XML sitemap

75419.2k9](/packages/eliashaeussler-cache-warmup)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
