PHPackages                             jdenda-trox/laravel-auth-logger - 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. jdenda-trox/laravel-auth-logger

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

jdenda-trox/laravel-auth-logger
===============================

Log user authentication actions in Laravel with added graylog connector.

00PHP

Since Dec 12Pushed 2y agoCompare

[ Source](https://github.com/jdenda-trox/laravel-auth-log)[ Packagist](https://packagist.org/packages/jdenda-trox/laravel-auth-logger)[ RSS](/packages/jdenda-trox-laravel-auth-logger/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Auth Log
================

[](#laravel-auth-log)

[![Latest Stable Version](https://camo.githubusercontent.com/a6c9b8285c4d453b05795754bb94e2f440306b41f4b8f8cffd58ecff2c3a33ca/68747470733a2f2f706f7365722e707567782e6f72672f6c6162656c38342f6c61726176656c2d617574682d6c6f672f762f737461626c653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/label84/laravel-auth-log)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Quality Score](https://camo.githubusercontent.com/f74bcee235f51f57ec8f9419ee5c10efe2a7a9a58561ee2c0fda89bf5e0d4fb7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c6162656c38342f6c61726176656c2d617574682d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/label84/laravel-auth-log)[![Total Downloads](https://camo.githubusercontent.com/aa21105e7f055b772dbada0455c7b4b49404814bf3374a83867276ece92534a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6162656c38342f6c61726176656c2d617574682d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/label84/laravel-auth-log)[![GitHub Workflow Status](https://camo.githubusercontent.com/a191daf3659734f4e517c141d805e431871fa09a4fb7ce00f35119a2211bda89/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6162656c38342f6c61726176656c2d617574682d6c6f672f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/a191daf3659734f4e517c141d805e431871fa09a4fb7ce00f35119a2211bda89/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6162656c38342f6c61726176656c2d617574682d6c6f672f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)

The `laravel-auth-log` package will log all the default Laravel authentication events (Login, Attempting, Lockout, etc.) to your database and optionally to graylog instance. In the config file you can select the events that you would like to log. It will save the event name, email, user id, ip address and user agent. No other configurations are required. This package could be useful for tracking unwanted activity in your Laravel application.

- [Laravel Support](#laravel-support)
- [Installation](#installation)
- [Usage](#usage)
- [Tests](#tests)
- [License](#license)

Laravel Support
---------------

[](#laravel-support)

VersionRelease10.x1.19.x1.1Installation
------------

[](#installation)

### 1. Install the package via composer

[](#1-install-the-package-via-composer)

```
composer require jdenda-trox/laravel-auth-log
```

### 2. Publish the config file and migration

[](#2-publish-the-config-file-and-migration)

```
php artisan vendor:publish --provider="Label84\AuthLog\AuthLogServiceProvider" --tag="config"
php artisan vendor:publish --provider="Label84\AuthLog\AuthLogServiceProvider" --tag="migrations"
```

### 3. Run migration

[](#3-run-migration)

```
php artisan migrate
```

Usage
-----

[](#usage)

In the config file `config/authlog.php` you can (un)comment the events that you'd like to log to your database.

```
// config/authlog.php

return [
    // ...
    'events' => [
        \Illuminate\Auth\Events\Attempting::class,
        // \Illuminate\Auth\Events\Authenticated::class,
        \Illuminate\Auth\Events\Failed::class,
        \Illuminate\Auth\Events\Lockout::class,
        \Illuminate\Auth\Events\Login::class,
        \Illuminate\Auth\Events\Logout::class,
        \Illuminate\Auth\Events\OtherDeviceLogout::class,
        \Illuminate\Auth\Events\PasswordReset::class,
        \Illuminate\Auth\Events\Registered::class,
        \Illuminate\Auth\Events\Verified::class,
    ],
];
```

In the same file you can can also change the database connection and table name.

### Enable/disable logging

[](#enabledisable-logging)

You can add the `AUTH_LOG_ENABLED=` to your `.env` file to enable/disable the logging to the database. Config for Graylog will follow.

```
// .env

AUTH_LOG_ENABLED=true
```

### Table format example

[](#table-format-example)

idevent\_nameemailuser\_idip\_addressuser\_agentcontextcreated\_at1Attempting127.0.0.1Mozilla/5.0 (Windows NT 10.0...2022-01-10 00:00:002Login1127.0.0.1Mozilla/5.0 (Windows NT 10.0...2022-01-10 00:00:00Tests
-----

[](#tests)

```
./vendor/bin/phpstan analyse
./vendor/bin/phpunit
```

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

###  Health Score

12

—

LowBetter than 0% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b7336de4bc0e9a3dc55b0ad2e68677ab17568f1cd62864d52e69ce77a2ed7458?d=identicon)[jdenda-trox](/maintainers/jdenda-trox)

---

Top Contributors

[![jdenda-trox](https://avatars.githubusercontent.com/u/86713011?v=4)](https://github.com/jdenda-trox "jdenda-trox (7 commits)")[![tjardoo](https://avatars.githubusercontent.com/u/31533540?v=4)](https://github.com/tjardoo "tjardoo (7 commits)")

### Embed Badge

![Health badge](/badges/jdenda-trox-laravel-auth-logger/health.svg)

```
[![Health](https://phpackages.com/badges/jdenda-trox-laravel-auth-logger/health.svg)](https://phpackages.com/packages/jdenda-trox-laravel-auth-logger)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M275](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M342](/packages/open-telemetry-sdk)

PHPackages © 2026

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