New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

codetech/laravel-api-logs

A lightweight Laravel package for logging requests made to your API.
1,351
Install
composer require codetech/laravel-api-logs
Latest Version:v3.2.1
PHP:^8.2
Laravel:11 · 12 · 13
Older releases:7 – 10
License:MIT
Last Updated:Oct 10, 2026
Links: GitHub  ·  Packagist
Maintainer: jfrosorio

Laravel API Logs

Laravel API Requests Logger

Latest version Total downloads Tests GitHub license

A lightweight Laravel package for logging the requests made to your API. Each authenticated request is stored with its URL, method, IP, payload, headers, response, and duration — linked to the user that made it, with sensitive values redacted before anything hits the database.

Quick start

composer require codetech/laravel-api-logs

Publish the migrations:

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

Run the migrations:

php artisan migrate

Append the middleware to the api middleware group in your bootstrap/app.php:

use CodeTech\ApiLogs\Http\Middleware\LogApiRequest;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Middleware;

return Application::configure(basePath: dirname(__DIR__))
    // ...
    ->withMiddleware(function (Middleware $middleware) {
        $middleware->appendToGroup('api', LogApiRequest::class);
    })
    // ...
    ->create();

Add the HasApiLogs trait to the model that makes the requests to browse its history:

use CodeTech\ApiLogs\Traits\HasApiLogs;

class User extends Authenticatable
{
    use HasApiLogs;
}

$user->apiLogs; // all ApiLog entries for the user

Documentation

To learn all about the package — configuration, guards, redaction — head over to the extensive documentation.

Upgrading from an older version? See the upgrade guide.

Changelog

Every release is documented on the GitHub releases page.

Contributing

Contributions are welcome! Please read the contributing guidelines before opening an issue or pull request.

Security

If you discover a security vulnerability, please follow the security policy — do not report it publicly.

Support

If this package helps you, consider starring the repository — it helps other developers discover it.


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!

Related Packages

cloudlink/textmagic-laravel

A Laravel wrapper for the TextMagic PHP SMS API.

75,791 0
mahdimajidzadeh/laravel-unsplash

Laravel package for the Unsplash API

11,364 11
luezoid/laravel-core

A feature rich Laravel package which provides fast & flexible way to quickly bui...

2,453 11
railken/lara-eye
38,915 39
api
ibondoc/bigbluebutton

BigBlueButton Server API Library for Laravel

8,005 0

Version History

Version Released PHP Laravel License
v3.2.1 ^8.2 ^11.0|^12.0|^13.0 MIT
v3.2.0 ^8.2 ^11.0|^12.0|^13.0 MIT
v3.1.1 ^8.2 ^11.0|^12.0|^13.0 MIT
v3.1.0 ^8.2 ^11.0|^12.0|^13.0 MIT
v3.0.0 ^8.2 ^11.0|^12.0|^13.0 MIT