PHPackages                             codetech/laravel-api-logs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. codetech/laravel-api-logs

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

codetech/laravel-api-logs
=========================

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

v3.2.0(1mo ago)0858[2 issues](https://github.com/CodeTechAgency/laravel-api-logs/issues)MITPHPPHP ^8.2CI passing

Since May 3Pushed 3w ago1 watchersCompare

[ Source](https://github.com/CodeTechAgency/laravel-api-logs)[ Packagist](https://packagist.org/packages/codetech/laravel-api-logs)[ RSS](/packages/codetech-laravel-api-logs/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (8)Versions (15)Used By (0)

[![Laravel API Logs](https://raw.githubusercontent.com/CodeTechAgency/laravel-api-logs/main/art/banner.png)](https://raw.githubusercontent.com/CodeTechAgency/laravel-api-logs/main/art/banner.png)

Laravel API Requests Logger
===========================

[](#laravel-api-requests-logger)

[![Latest version](https://camo.githubusercontent.com/a4973e6c2291a4bd9f14a31a919da2afe7c3014eb4e9ef770d47a9da8f1d4423/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f436f6465546563684167656e63792f6c61726176656c2d6170692d6c6f67733f7374796c653d666c61742d737175617265)](https://github.com/CodeTechAgency/laravel-api-logs/releases)[![Total downloads](https://camo.githubusercontent.com/70f03398a5d9dbcdd41a06434021580fcf980f8388ea9d75843353115f838da7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6465746563682f6c61726176656c2d6170692d6c6f67733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codetech/laravel-api-logs)[![Tests](https://camo.githubusercontent.com/ef7db88108ddbcfb1e74198545484b2e50c26e0d3ec5113aeca396a72db21d84/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f436f6465546563684167656e63792f6c61726176656c2d6170692d6c6f67732f74657374732e796d6c3f7374796c653d666c61742d737175617265266c6162656c3d7465737473)](https://github.com/CodeTechAgency/laravel-api-logs/actions/workflows/tests.yml)[![GitHub license](https://camo.githubusercontent.com/16442c5d9db34172e21979f16e7d4f89832252b5a03ea3feb6845253061e8de4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f436f6465546563684167656e63792f6c61726176656c2d6170692d6c6f67733f7374796c653d666c61742d737175617265)](https://github.com/CodeTechAgency/laravel-api-logs/blob/main/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
-----------

[](#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
-------------

[](#documentation)

To learn all about the package — configuration, guards, redaction — head over to [the extensive documentation](https://www.codetech.pt/open-source/laravel-api-logs).

Upgrading from an older version? See the [upgrade guide](https://github.com/CodeTechAgency/laravel-api-logs/blob/main/UPGRADE.md).

Changelog
---------

[](#changelog)

Every release is documented on the [GitHub releases page](https://github.com/CodeTechAgency/laravel-api-logs/releases).

Contributing
------------

[](#contributing)

Contributions are welcome! Please read the [contributing guidelines](https://github.com/CodeTechAgency/laravel-api-logs/blob/main/CONTRIBUTING.md) before opening an issue or pull request.

Security
--------

[](#security)

If you discover a security vulnerability, please follow the [security policy](https://github.com/CodeTechAgency/laravel-api-logs/blob/main/SECURITY.md) — do not report it publicly.

Support
-------

[](#support)

If this package helps you, consider [starring the repository](https://github.com/CodeTechAgency/laravel-api-logs) — it helps other developers discover it.

---

License
-------

[](#license)

**codetech/laravel-api-logs** is open-sourced software licensed under the [MIT license](https://github.com/CodeTechAgency/laravel-api-logs/blob/main/LICENSE).

About CodeTech
--------------

[](#about-codetech)

[CodeTech](https://www.codetech.pt) is a web development agency based in Matosinhos, Portugal. Oh, and we LOVE Laravel!

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance94

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~90 days

Recently: every ~0 days

Total

14

Last Release

34d ago

Major Versions

v1.0.3 → v2.0.02025-03-31

v2.0.2 → v3.0.02026-07-14

v1.x-dev → v2.x-dev2026-07-14

v2.x-dev → v3.1.12026-07-14

PHP version history (2 changes)v1.0.0PHP ^7.2|^8.0

v3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/6adaef8b30d5d0dee7bc2484fd9b0a9ad33e38afb78fc5d18d79d6239c811c76?d=identicon)[jfrosorio](/maintainers/jfrosorio)

---

Top Contributors

[![jfrosorio](https://avatars.githubusercontent.com/u/17640929?v=4)](https://github.com/jfrosorio "jfrosorio (20 commits)")

---

Tags

apiapi-loggingdebugginglaravellaravel-packageloggingmiddlewarephpsecurityapilaravellaravel-packagelogscodetechlaravel-api-logs

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/codetech-laravel-api-logs/health.svg)

```
[![Health](https://phpackages.com/badges/codetech-laravel-api-logs/health.svg)](https://phpackages.com/packages/codetech-laravel-api-logs)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[spatie/laravel-health

Monitor the health of a Laravel application

88212.7M188](/packages/spatie-laravel-health)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M319](/packages/laravel-ai)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
