laraflow/backpack-api-log

Backpack API Log is a database oriented api request and response logger for backpack admin panel

0.2.0 2023-04-08 20:00 UTC

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Installation

You can install the package via composer:

composer require laraflow/backpack-api-log

You can run complete installation with:

php artisan backpack-api-log:install
php artisan migrate

Optionally, Install command will publish config and migration. For others, you can publish the config & migration file with:

php artisan vendor:publish --tag="api-log-config"
php artisan vendor:publish --tag="api-log-migration"

This is the contents of the published config file:

return [
    'table' => 'api_logs',
    'model' => \Laraflow\BackpackApiLog\Models\BackpackApiLog::class,
    'route' => 'api-log',
    'enabled' => env('BACKPACK_API_LOG', false),
    'logs' => [
        //which methods should be logged
        'method' => [
            'GET' => 'GET',
            'POST' => 'POST',
            'PUT' => 'PUT',
            'PATCH' => 'PATCH',
            'DELETE' => 'DELETE',
            'OPTION' => 'OPTION',
        ],
        //which api endpoints should be logged
        'host' => [
            //
        ],
        //which api http status code should be logged
        'code' => [
            '200' => '200',
            '400' => '400',
            '500' => '500',
            '404' => '404',
            '422' => '422',
            '419' => '419',
        ],
    ],
];

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.