Увійти Реєстрація
Блог Серії
Кар'єра
Вакансії Компанії
Навчання
Документація Співбесіди Тестування Відео
Екосистема
Пакети Ресурси Проєкти Інструменти Події
Інше
Про нас Реклама

Laravel Spy

farayaz/laravel-spy
v1.7.2 13 212 34.5k 19 травня 2026
На GitHub

Laravel пакет для відстеження вихідних HTTP-запитів.

3

Поділитись

README

Laravel Spy Logo

Latest Version on Packagist Total Downloads License

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

  • 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

  • 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

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

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:

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

Configure these via environment variables:

SPY_ENABLED=true
SPY_DASHBOARD_ENABLED=false

Documentation

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

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

Contact

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

Коментарі

Увійдіть, щоб залишити коментар

Будьте першим, хто залишить коментар!

Схожі пакети

Laravel Debugbar

barryvdh/laravel-debugbar

Інтеграція PHP Debugbar у Laravel для відлагодження та аналізу роботи додатку.

19,277 v4.4.3 13 11

Pest

pestphp/pest

Тестовий фреймворк з лаконічним синтаксисом поверх PHPUnit: тести описуються функціями замість класів. Має паралельний запуск, тести архітектури, покриття і мутаційне тестування.

11,667 v5.1.1 2

Rector

rector/rector

Автоматичний рефакторинг і оновлення коду: піднімає синтаксис до нової версії PHP, застосовує набори правил для Laravel і виправляє застарілі API масово, а не вручну по файлах.

10,405 2.6.3 1

Larastan

nunomaduro/larastan

Larastan — це розширення phpstan/phpstan для Laravel, яке дозволяє виявляти помилки у коді без його запуску.

6,500 v3.11.0 13 9

Larastan

larastan/larastan

Статичний аналіз для Laravel: вчить PHPStan розуміти фасади, магічні методи Eloquent і контейнер. Ловить помилки типів і неіснуючі методи до того, як код дійде до тестів.

6,482 v3.10.0 13 1

Laravel Backup

spatie/laravel-backup

Пакет для створення резервних копій вашого Laravel-додатку.

6,018 10.3.2 13 10