LaravelPackages.net
Acme Inc.
Toggle sidebar
codetech/laravel-api-logs

A lightweight Laravel package for logging requests made to your API.

848
0
v2.0.1
About codetech/laravel-api-logs

codetech/laravel-api-logs is a Laravel package for a lightweight laravel package for logging requests made to your api.. It currently has 0 GitHub stars and 848 downloads on Packagist (latest version v2.0.1). Install it with composer require codetech/laravel-api-logs. Discover more Laravel packages by codetech or browse all Laravel packages to compare alternatives.

Last updated

Laravel API Requests Logger

A lightweight Laravel package for logging requests made to your API.

Latest version GitHub license

Installation

Add the package to your Laravel application using composer:

composer require codetech/laravel-api-logs

Service Provider

The service provider will be automatically registered during the installation process. However, you can manually register it by adding it to the list of providers located in your config/app.php file:

'providers' => [
    ...
    Codetech\ApiLogs\Providers\ApiLogServiceProvider::class,

],

Migrations

Publish the migration file:

php artisan vendor:publish --provider=CodeTech\\ApiLogs\\Providers\\ApiLogServiceProvider --tag=migrations

Run the migration:

php artisan migrate

Usage

To start logging requests made to your API, you simply add the middleware to the API's route middleware group, located in your app/Http/Kernel.php:

use CodeTech\ApiLogs\Http\Middleware\LogApiRequest;


protected $middlewareGroups = [
    ...

    'api' => [
        ...
        LogApiRequest::class,
    ],
];

License

codetech/laravel-api-logs is open-sourced software licensed under the MIT license.

About CodeTech

CodeTech is a web development agency based in Matosinhos, Portugal. Oh, and we LOVE Laravel!

Star History Chart