This package may help you to log api request,response,duration,method,ip,http status and retireved classes (controller,model,etc...) in database.
- Install the package via composer
composer require cracki/dogger
- Publish the config file
php artisan vendor:publish --tag=config --provider="Cracki\Dogger\DoggerServiceProvider"
- Migrate Table
php artisan migrate
//in api.php or web.php
Route::group([
'middleware'=> 'dogger'
], function () {
...
//Your routes is here.
...
});
//response json as follow
{
'result' : 'error', // (or 'success' accepted only 2 enum)
...
}
route | method | description |
---|---|---|
/dogger | get | view logs |
/dogger/delete | post | clear logs |
/dogger/api/get-all | get | get logs with json |
/dogger/api/delete-all | post | delete all |
Licensed under The MIT License (MIT).