Skip to content

A database oriented api request and response logger for laravel backpack admin panel

License

Notifications You must be signed in to change notification settings

laraflow/backpack-api-log

Repository files navigation

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

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.

About

A database oriented api request and response logger for laravel backpack admin panel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages