PHPackages                             farayaz/laravel-spy - 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. farayaz/laravel-spy

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

farayaz/laravel-spy
===================

A Laravel package to track outgoing HTTP requests.

v1.7.2(1mo ago)21321.2k↑63.5%13MITPHPPHP ^8.1CI failing

Since May 6Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/farayaz/laravel-spy)[ Packagist](https://packagist.org/packages/farayaz/laravel-spy)[ RSS](/packages/farayaz-laravel-spy/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (12)Versions (27)Used By (0)

 [![Laravel Spy Logo](./laravel-spy.svg)](./laravel-spy.svg)

 [ ![Latest Version on Packagist](https://camo.githubusercontent.com/51eebeef67ff3289c28208561618c76ca69fa93ac2b741cbc1e021c4c9953fa9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6661726179617a2f6c61726176656c2d7370792e7376673f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/farayaz/laravel-spy) [ ![Total Downloads](https://camo.githubusercontent.com/e1eb369a6a5d592896a5369b9aeb13fe91d5c555ce71cc2c543cf2c75fbd5b94/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6661726179617a2f6c61726176656c2d7370792e7376673f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/farayaz/laravel-spy) [ ![License](https://camo.githubusercontent.com/e5948552d7ae45c56368191b87c11466e02c205d1ccf80b6a91510d85b107a11/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6661726179617a2f6c61726176656c2d7370792e7376673f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/farayaz/laravel-spy)

Laravel Spy
===========

[](#laravel-spy)

**Laravel Spy** is a lightweight Laravel package designed to track and log outgoing HTTP requests made by your Laravel application.

This package is useful for debugging, monitoring, and auditing external API calls or HTTP requests, providing developers with a zero config, simple way to inspect request details such as URLs, methods, headers, and responses.

Features
--------

[](#features)

- Tracks all outgoing HTTP requests made via Laravel's HTTP client.
- Tracks outgoing requests made with Guzzle (enabled by default).
- Logs request details, including URL, method, headers, payload, and response.
- Configurable logging options to customize and obfuscate sensitive data.

Requirements
------------

[](#requirements)

- **PHP**: ^8.1
- **Laravel**: ^10.0 | ^11.0 | ^12.0 | ^13.0
- **Development Dependencies** (optional):
    - `laravel/pint`: ^1.0 (for code style linting)
    - `phpunit/phpunit`: ^9.0 | ^10.0 | ^11.0 (for running tests)

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require farayaz/laravel-spy
```

The package uses Laravel's auto-discovery feature. After installation, the package is ready to use with its default configuration.

```
php artisan vendor:publish --provider="Farayaz\LaravelSpy\LaravelSpyServiceProvider"
```

```
php artisan migrate
```

Usage
-----

[](#usage)

Once installed and configured, Laravel Spy automatically tracks all outgoing HTTP requests made using Laravel's Http facade and Guzzle. The package logs the following details for each request:

- The full URL of the request
- The HTTP method (e.g., GET, POST, PUT)
- Request Headers
- Request Body
- Response Header
- Response Body
- Response HTTP Status code
- Request duration (milliseconds)

Example:
--------

[](#example)

After installing `laravel-spy` and publishing the configuration, any usage of Laravel's HTTP client (for example, in your controllers or jobs) will be automatically logged.

Laravel Spy will log the details of this outgoing request to the `http_logs` table in your database.

```
Http::get('https://github.com/farayaz/laravel-spy/');
```

Quick Configuration
-------------------

[](#quick-configuration)

Configure these via environment variables:

```
SPY_ENABLED=true
SPY_DASHBOARD_ENABLED=false
```

Documentation
-------------

[](#documentation)

- [Configuration](docs/configuration.md)
- [Guzzle Integration](docs/guzzle.md)
- [Dashboard](docs/dashboard.md)
- [Cleanup and Retention](docs/cleanup.md)
- [Troubleshooting](docs/troubleshooting.md)
- [Upgrade Guide](docs/upgrade.md)
- [Contributing](docs/contributing.md)
- [Testing Guide](README_TESTING.md)

Issues
------

[](#issues)

If you encounter any issues or have feature requests, please open an issue on the GitHub repository. Provide as much detail as possible, including:

- Laravel version
- PHP version
- Package version
- Steps to reproduce
- Expected vs. actual behavior
- Any relevant error messages or logs

License
-------

[](#license)

Laravel Spy is open-sourced software licensed under the MIT License.

Contact
-------

[](#contact)

For questions or support, reach out via the GitHub repository or open an issue.

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance91

Actively maintained with recent releases

Popularity47

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.1% 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 ~16 days

Recently: every ~4 days

Total

24

Last Release

45d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4258955?v=4)[Mehrdad Motaghifar](/maintainers/mehrdadx10)[@mehrdadx10](https://github.com/mehrdadx10)

---

Top Contributors

[![mehrdadx10](https://avatars.githubusercontent.com/u/4258955?v=4)](https://github.com/mehrdadx10 "mehrdadx10 (53 commits)")[![amirmms](https://avatars.githubusercontent.com/u/14109632?v=4)](https://github.com/amirmms "amirmms (11 commits)")[![rezakhademix](https://avatars.githubusercontent.com/u/70235203?v=4)](https://github.com/rezakhademix "rezakhademix (10 commits)")[![murphatron](https://avatars.githubusercontent.com/u/30440375?v=4)](https://github.com/murphatron "murphatron (3 commits)")[![arkdev1](https://avatars.githubusercontent.com/u/138211005?v=4)](https://github.com/arkdev1 "arkdev1 (1 commits)")[![oveysrostami](https://avatars.githubusercontent.com/u/9713287?v=4)](https://github.com/oveysrostami "oveysrostami (1 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/farayaz-laravel-spy/health.svg)

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

###  Alternatives

[binaryk/laravel-restify

Laravel REST API helpers

677415.0k](/packages/binaryk-laravel-restify)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[lomkit/laravel-rest-api

A package to build quick and robust rest api for the Laravel framework.

59463.6k](/packages/lomkit-laravel-rest-api)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[wirechat/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

56910.0k](/packages/wirechat-wirechat)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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