Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lezhnev74/apideveloperio-laravel
Laravel API adapter to track each http request app handled.
https://github.com/lezhnev74/apideveloperio-laravel
analytics-dashboard http-requests laravel logging php
Last synced: 3 months ago
JSON representation
Laravel API adapter to track each http request app handled.
- Host: GitHub
- URL: https://github.com/lezhnev74/apideveloperio-laravel
- Owner: lezhnev74
- License: mit
- Created: 2017-07-01T14:14:06.000Z (over 7 years ago)
- Default Branch: laravel-54
- Last Pushed: 2018-06-22T08:49:52.000Z (over 6 years ago)
- Last Synced: 2024-10-13T12:29:31.033Z (3 months ago)
- Topics: analytics-dashboard, http-requests, laravel, logging, php
- Language: PHP
- Homepage: http://apideveloper.io
- Size: 201 KB
- Stars: 21
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Packagist](https://img.shields.io/packagist/dt/lezhnev74/apideveloperio-laravel.svg)]()
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/lezhnev74/apideveloperio-laravel/master/LICENSE)
[![Build Status](https://travis-ci.org/lezhnev74/apideveloperio-laravel.svg?branch=laravel-54)](https://travis-ci.org/lezhnev74/apideveloperio-laravel)# Laravel package to dump HTTP requests to your Dashboard
Laravel API adapter to track each http request app handled.## Installation
### Version Compability
Laravel version | Package version | Composer command
:---------|:----------|:---------
5.3.x | 3.0.x | `composer require "lezhnev74/apideveloperio-laravel=~3.0"`
5.4.x, 5.5.x, 5.6.x | 4.0.x | `composer require "lezhnev74/apideveloperio-laravel=~4.0"`### Steps
#### 1. Install the package```
composer require "lezhnev74/apideveloperio-laravel=~3.0"
```#### 2. Add service provider to your `config/app.php`
```php
'providers' => [
...
'\HttpAnalyzer\Laravel\HttpAnalyzerServiceProvider'
],
```#### 3. Run this this command to publish configuration file to your `/config` folder.
```
php artisan vendor:publish --provider="HttpAnalyzer\Laravel\HttpAnalyzerServiceProvider"
```#### 4. Set-up cron command
To dump recorded requests to the Dashboard. Open your `app/Console/Kernel.php` and add class to commands list.```php
#app/Console/Kernel.php
....
protected $commands = [
...
'\HttpAnalyzer\Laravel\DumpRecordedRequests',
];...
protected function schedule(Schedule $schedule)
{
// you can set how often you want it to dump your requests to the Dashboard
// every minute is the most frequent mode
$schedule->command('http_analyzer:dump')->everyMinute();
}
```#### 5. That's it!
## Configuration
After publishing, config file will be located at `config/http_analyzer.php` and speaks for himself.
The only required configuration is to put your API Key under `api_key` field.## FAQ
#### How it works?
It hooks into Laravel app and records request, response and other data that you will see in your Dashboard:
* incoming request
* response
* database queries
* log entriesYou can tweak which information you would like to send to the Dashboard.
The command `http_analyzer:dump` that you have set up will send all recorded requests to your Dashboard.
#### I see no errors on the screen, but I don't see any requests in my dashboard. Why?
This package is designed to fail silently. If something went wrong while recording your requests - plugin won't interrupt your request lifecycle. Open your log and see if the package appended any critical information in there.Also check the tmp storage folder if there are any stale dump files.
## Suggestions
#### If user IPs are always 127.0.0.1That happens due to some Symfony's Request issue. Try using this package - https://github.com/fideloper/TrustedProxy. Should do the trick.
#### What is the best way to track each request?
When someone refers to particular request/response app cycle, it is best to know it's unique ID.
Knowing it you can easily find it in the Dashboard.
Just add a middleware (like this one https://github.com/softonic/laravel-middleware-request-id) which will append a unique ID to each response your app provides.## 🏆 Contributors
- [Owen Melbourne](https://github.com/OwenMelbz) - improved dates conversions
- [Mark Topper](https://github.com/marktopper) - added support for Laravel 5.6## Support
Just open a new Issue here and get help.