PHPackages                             fikrimastor/audit-login - 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. fikrimastor/audit-login

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

fikrimastor/audit-login
=======================

Audit login is a another package for laravel framework. The purpose is to auditing login events

v1.1.1(1y ago)0131[2 PRs](https://github.com/fikrimastor/audit-login/pulls)MITPHPPHP ^8.1CI passing

Since Dec 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/fikrimastor/audit-login)[ Packagist](https://packagist.org/packages/fikrimastor/audit-login)[ Docs](https://github.com/fikrimastor/audit-login)[ GitHub Sponsors]()[ RSS](/packages/fikrimastor-audit-login/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (13)Versions (7)Used By (0)

Audit Login with Laravel
========================

[](#audit-login-with-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a4715ca32775c028f4cf8b7b678f61d3e820f64077818141720aa978f080f638/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66696b72696d6173746f722f61756469742d6c6f67696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fikrimastor/audit-login)[![GitHub Tests Action Status](https://camo.githubusercontent.com/bffba779eca4ea312a40ee30a866a019b1b2f44a7042711eabca3643c9bfad58/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f66696b72696d6173746f722f61756469742d6c6f67696e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/fikrimastor/audit-login/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/5219df9bb92f39c29c70db0ed873d22632fea0ff8f89245b62132f5537935781/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f66696b72696d6173746f722f61756469742d6c6f67696e2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/fikrimastor/audit-login/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/27235949db9460a40ee347f6b89d44c46d8af9a29636a9bfb082c08a619914c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66696b72696d6173746f722f61756469742d6c6f67696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fikrimastor/audit-login)

Audit login is another package for [Laravel](https://laravel.com/) framework. The purpose is auditing login events

Support us
----------

[](#support-us)

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

[](#installation)

You can install the package via composer:

```
composer require fikrimastor/audit-login
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="audit-login-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="audit-login-config"
```

This is the contents of the published config file:

```
return [
    'enabled' => env('AUDIT_LOGIN_ENABLED', true),
    'drivers' => [
        'database' => [
            'table' => env('AUDIT_LOGIN_DATABASE_TABLE', 'audit-logins'),
            'connection' => env('AUDIT_LOGIN_DATABASE_CONNECTION', 'mysql'),
        ],
    ],
    ...
];
```

Usage
-----

[](#usage)

If you want to custom some actions, for example, while user login, you want to send an email notification, you may create new service provider and defined it in config/app.php.

So, under the new service provider, under the boot method, you can do something like this:

```
use \FikriMastor\AuditLogin\Facades\AuditLogin;
use \YourProjectNamespace\YourCustomLoginEventClass;

public function boot(): void
{
    AuditLogin::recordLoginUsing(YourCustomLoginEventClass::class);
}
```

And then, you can create a new class for your custom login event action class, for example:

```
use \FikriMastor\AuditLogin\Contracts\LoginEventContract;

class YourCustomLoginEventClass implements LoginEventContract
{
    public function handle(object $event, AuditLoginAttribute $attributes): void
    {
        AuditLogin::auditEvent($event, $attributes);

        // Do something here

        // Send email notification

    }
}
```

The event object consists of the user object logged in, and the attribute object is the object that contains the login event attributes.

Some of it use Authenticatable contract, so you can use it to get the user data.

You may learn about Auth events in Laravel [here](https://laravel.com/api/11.x/Illuminate/Auth/Events.html).

Testing
-------

[](#testing)

```
composer test
```

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](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Fikri Mastor](https://github.com/fikrimastor)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance41

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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 ~5 days

Total

4

Last Release

502d ago

PHP version history (2 changes)1.0.0PHP ^8.2

1.1.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/05693f8257a9a2b5b2f3c472c911aa2ff902a6d37c053320999ddc17e457d729?d=identicon)[fikrimastor](/maintainers/fikrimastor)

---

Top Contributors

[![fikrimastor](https://avatars.githubusercontent.com/u/18373448?v=4)](https://github.com/fikrimastor "fikrimastor (50 commits)")

---

Tags

auditauthenticationeventslaravellistenerslogsqueueeventlaravelqueuelistenerFikri Mastoraudit-login

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/fikrimastor-audit-login/health.svg)

```
[![Health](https://phpackages.com/badges/fikrimastor-audit-login/health.svg)](https://phpackages.com/packages/fikrimastor-audit-login)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

339785.3k8](/packages/laragear-two-factor)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)

PHPackages © 2026

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