The Laravel Spy package is a lightweight package to track and log outgoing HTTP requests in your application. It features a zero-config way to log all requests made with the Laravel HTTP client, useful for debugging and monitoring external API calls made in your application.
It works with Laravel v10.x+, and includes sensible defaults to start logging immediately after installing the package. You can easily turn off the Laravel Spy logging, configure which URLs are excluded, and ensure sensitive fields are obfuscated.
This package uses a global middleware to log requests, and you can ensure that requests are cleaned up in production using the provided spy:clean Artisan command. I recommend configuring this package to remove sensitive fields in production environments before use.
Main Features
- Tracks all outgoing HTTP requests made via Laravel's HTTP client.
- Logs request details, including URL, method, headers, payload, and response.
- Configurable logging options to customize and obfuscate sensitive data.
💻 You can get started with this package on GitHub: farayaz/laravel-spy.