PHPackages                             akira/laravel-auth-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. akira/laravel-auth-logs

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

akira/laravel-auth-logs
=======================

Track, query, and act on authentication activity in your Laravel application. Automatically records successful and failed sign-ins, with optional notifications and geolocation context.

v1.2.0(1w ago)63.1k↓70.8%MITPHPPHP ^8.4CI passing

Since May 24Pushed 1w ago1 watchersCompare

[ Source](https://github.com/akira-io/laravel-auth-logs)[ Packagist](https://packagist.org/packages/akira/laravel-auth-logs)[ Docs](https://github.com/akira-io/laravel-auth-logs)[ GitHub Sponsors](https://github.com/Akira)[ RSS](/packages/akira-laravel-auth-logs/feed)WikiDiscussions 1.x Synced 3d ago

READMEChangelog (6)Dependencies (32)Versions (33)Used By (0)

Laravel Authentication Logs
===========================

[](#laravel-authentication-logs)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b815bf38700a49638edb842cb1fd7ae21e1eb3efc3f39153e0472b306729028a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616b6972612f6c61726176656c2d617574682d6c6f67732e737667)](https://packagist.org/packages/akira/laravel-auth-logs)[![Total Downloads](https://camo.githubusercontent.com/3d380de06cc80bc702aa922452737b7d05bd363739089a245b078bca1167c9c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616b6972612f6c61726176656c2d617574682d6c6f67732e737667)](https://packagist.org/packages/akira/laravel-auth-logs)[![PHPStan Level](https://camo.githubusercontent.com/3eef5bfb737c3eb8f74ff340fd46dc7a1cc6a5af7e425296fcec68a1ad6f5ad9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068707374616e2d6c6576656c253230392d627269676874677265656e2e737667)](https://phpstan.org)[![License](https://camo.githubusercontent.com/c68c37815ad447030c0c34eed54ec4dc8a0c4e1c80eb62d9a2f920619305c696/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616b6972612f6c61726176656c2d617574682d6c6f67732e737667)](https://github.com/akira-io/laravel-auth-logs/blob/main/LICENSE)[![img.png](img.png)](img.png)

Laravel Authentication Logs records authentication activity for Laravel applications. It listens to Laravel authentication events, stores request context in a polymorphic log table, and sends mail notifications for security-relevant events.

Features
--------

[](#features)

- Records successful login attempts.
- Records failed login attempts when Laravel provides a user instance.
- Marks the latest authentication log as logged out on user logout.
- Detects new devices by successful login history for the same IP address and user agent.
- Sends queued mail notifications for failed login and new device login events.
- Resolves optional geolocation context for notification messages.
- Supports configurable table name, database connection, events, listeners, templates, notification toggles, and retention value.

The package also subscribes to Laravel's `OtherDeviceLogout` event as a customization hook. The default listener does not write a log entry.

Requirements
------------

[](#requirements)

- PHP 8.4 or higher
- Laravel 12.0 or 13.0
- An authenticatable model that uses Laravel notifications

The test workflow validates both Laravel 12 and Laravel 13 dependency sets.

Installation
------------

[](#installation)

Install the package with Composer:

```
composer require akira/laravel-auth-logs
```

Publish the configuration and migration:

```
php artisan auth-logs:install
php artisan migrate
```

Add the `AuthLogs` trait to your authenticatable model:

```
use Akira\LaravelAuthLogs\Concerns\AuthLogs;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable
{
    use Notifiable, AuthLogs;
}
```

Documentation
-------------

[](#documentation)

Full documentation is available under [docs/](docs/README.md):

- [Installation](docs/01-installation.md)
- [Configuration](docs/02-configuration.md)
- [Usage](docs/03-usage.md)
- [Notifications](docs/04-notifications.md)
- [Architecture](docs/05-architecture.md)
- [Data Flow](docs/06-data-flow.md)
- [Security](docs/07-security.md)
- [Advanced Usage](docs/08-advanced-usage.md)
- [API Reference](docs/09-api-reference.md)
- [Operations](docs/10-operations.md)
- [Testing](docs/11-testing.md)
- [Troubleshooting](docs/12-troubleshooting.md)
- [FAQ](docs/13-faq.md)
- [Roadmap](docs/14-roadmap.md)

Testing
-------

[](#testing)

```
composer test
```

The full gate runs Pint, Rector dry-run, PHPStan, Pest type coverage, and Pest coverage.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](https://github.com/akira-io/laravel-auth-logs/security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [kid](https://github.com/akira-io)
- [All Contributors](https://github.com/akira-io/laravel-auth-logs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance98

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 74.1% 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 ~66 days

Recently: every ~61 days

Total

7

Last Release

8d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c42e59ca0b3864a382dc0c3e290f8cf7d75bbe3eab10a3af0f71d5785f89d0bc?d=identicon)[kidiatoliny](/maintainers/kidiatoliny)

---

Top Contributors

[![kidiatoliny](https://avatars.githubusercontent.com/u/48266788?v=4)](https://github.com/kidiatoliny "kidiatoliny (129 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (19 commits)")[![akira-foundation[bot]](https://avatars.githubusercontent.com/in/3206645?v=4)](https://github.com/akira-foundation[bot] "akira-foundation[bot] (15 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 commits)")

---

Tags

laravelakiralaravel-auth-logs

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/akira-laravel-auth-logs/health.svg)

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M101](/packages/dedoc-scramble)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

213421.2k2](/packages/wnx-laravel-backup-restore)

PHPackages © 2026

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