Skip to main content
Back to packages
212 GitHub stars

farayaz/laravel-spy

View on GitHub

Description

Laravel Spy is a lightweight package to track and log outgoing HTTP requests

Once installed and configured, Laravel Spy automatically tracks all outgoing HTTP requests made using Laravel's Http facade or HTTP client. 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/');

Related Content on Laravel Daily

Video

Recent Courses on Laravel Daily

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.