farayaz/laravel-spy
Zero-config Laravel package to spy on outgoing HTTP calls. Automatically logs Laravel Http facade and Guzzle requests with URL, method, headers, payload, response/status, and duration. Includes configurable logging and obfuscation for sensitive data.
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.
laravel/pint: ^1.0 (for code style linting)phpunit/phpunit: ^9.0 | ^10.0 | ^11.0 (for running tests)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
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:
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/');
Configure these via environment variables:
SPY_ENABLED=true
SPY_DASHBOARD_ENABLED=false
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 Spy is open-sourced software licensed under the MIT License.
For questions or support, reach out via the GitHub repository or open an issue.
How can I help you explore Laravel packages today?