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 1w 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

28

—

LowBetter than 51% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

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

602d ago

PHP version history (2 changes)1.0.0PHP ^8.2

1.1.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18373448?v=4)[Fikri Mastor](/maintainers/fikrimastor)[@fikrimastor](https://github.com/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

13.0k107.5M1.6k](/packages/spatie-laravel-permission)[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.6M322](/packages/laravel-ai)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)[masterix21/laravel-licensing

Laravel licensing package with polymorphic assignment to any model, activation keys, expirations/renewals, and seat control via LicenseUsage. Supports offline verification with public-key–signed tokens, a CLI to generate/rotate/revoke keys, and an extensible architecture via config and contracts.

1614.1k4](/packages/masterix21-laravel-licensing)

PHPackages © 2026

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