PHPackages                             serwin35/laravel-authentication-log - 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. serwin35/laravel-authentication-log

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

serwin35/laravel-authentication-log
===================================

Laravel Authentication Log provides authentication logger and notification for Laravel.

v1.2.5(5y ago)0275MITPHPPHP &gt;=7.0

Since Nov 19Pushed 5y agoCompare

[ Source](https://github.com/serwin35/laravel-authentication-log)[ Packagist](https://packagist.org/packages/serwin35/laravel-authentication-log)[ RSS](/packages/serwin35-laravel-authentication-log/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (10)Versions (6)Used By (0)

Laravel Authentication Log
==========================

[](#laravel-authentication-log)

[![Build Status](https://camo.githubusercontent.com/f4f29c6a5e5b434b4e95cee3e1286bf9b387ebd93d57ad20d61f4f254b7104b5/68747470733a2f2f7472617669732d63692e6f72672f73657277696e33352f6c61726176656c2d61757468656e7469636174696f6e2d6c6f672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/serwin35/laravel-authentication-log)[![StyleCI](https://camo.githubusercontent.com/af4510d7301a4ae77895040531a04c315ad5f8759e0bc537c4de0a98d6927cde/68747470733a2f2f7374796c6563692e696f2f7265706f732f3232323739323633372f736869656c643f6272616e63683d6d6173746572267374796c653d666c6174)](https://styleci.io/repos/222792637)[![Quality Score](https://camo.githubusercontent.com/64f4d89589857143b23a1f11e5129af4f303987c9d2a29c3cfd856f6d4d10af3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f73657277696e33352f6c61726176656c2d61757468656e7469636174696f6e2d6c6f672e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/serwin35/laravel-authentication-log)[![Total Downloads](https://camo.githubusercontent.com/8972f75412e54ca03bbedded084d5286d6d0a5b917067af8abde193d2db62c96/68747470733a2f2f706f7365722e707567782e6f72672f73657277696e33352f6c61726176656c2d61757468656e7469636174696f6e2d6c6f672f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/serwin35/laravel-authentication-log)[![GitHub license](https://camo.githubusercontent.com/f48f8d6cf609f5b181b9c3218a85175fe8a5809c7ea400347f39697a5d55065d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174)](https://raw.githubusercontent.com/serwin35/laravel-authentication-log/master/LICENSE)

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

[](#installation)

> Laravel Authentication Log requires Laravel 5.5 or higher, and PHP 7.0+.

You may use Composer to install Laravel Authentication Log into your Laravel project:

```
composer require serwin35/laravel-authentication-log

```

### Configuration

[](#configuration)

After installing the Laravel Authentication Log, publish its config, migration and view, using the `vendor:publish` Artisan command:

```
php artisan vendor:publish --provider="serwin35\AuthenticationLog\AuthenticationLogServiceProvider"

```

Next, you need to migrate your database. The Laravel Authentication Log migration will create the table your application needs to store authentication logs:

```
php artisan migrate

```

Finally, add the `AuthenticationLogable` and `Notifiable` traits to your authenticatable model (by default, `App\User` model). These traits provides various methods to allow you to get common authentication log data, such as last login time, last login IP address, and set the channels to notify the user when login from a new device:

```
use Illuminate\Notifications\Notifiable;
use serwin35\AuthenticationLog\AuthenticationLogable;
use Illuminate\Foundation\Auth\User as Authenticatable;

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

### Basic Usage

[](#basic-usage)

Get all authentication logs for the user:

```
User::find(1)->authentications;
```

Get the user last login info:

```
User::find(1)->lastLoginAt();

User::find(1)->lastLoginIp();
```

Get the user previous login time &amp; ip address (ignoring the current login):

```
auth()->user()->previousLoginAt();

auth()->user()->previousLoginIp();
```

### Notify login from a new device

[](#notify-login-from-a-new-device)

Notifications may be sent on the `mail`, `nexmo`, and `slack` channels. By default notify via email.

You may define `notifyAuthenticationLogVia` method to determine which channels the notification should be delivered on:

```
/**
 * The Authentication Log notifications delivery channels.
 *
 * @return array
 */
public function notifyAuthenticationLogVia()
{
    return ['nexmo', 'mail', 'slack'];
}
```

Of course you can disable notification by set the `notify` option in your `config/authentication-log.php` configuration file to `false`:

```
'notify' => env('AUTHENTICATION_LOG_NOTIFY', false),
```

Change name table in config.

```
'table_name' => 'users_auth_log',
```

### Clear old logs

[](#clear-old-logs)

You may clear the old authentication log records using the `authentication-log:clear` Artisan command:

```
php artisan authentication-log:clear

```

Records that is older than the number of days specified in the `older` option in your `config/authentication-log.php` will be deleted:

```
'older' => 365,
```

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

[](#contributing)

Thank you for considering contributing to the Laravel Authentication Log.

License
-------

[](#license)

Laravel Authentication Log is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.7% 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 ~99 days

Total

5

Last Release

1967d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4369427?v=4)[Mateusz](/maintainers/serwin35)[@serwin35](https://github.com/serwin35)

---

Top Contributors

[![yakidahan](https://avatars.githubusercontent.com/u/7757560?v=4)](https://github.com/yakidahan "yakidahan (17 commits)")[![serwin35](https://avatars.githubusercontent.com/u/4369427?v=4)](https://github.com/serwin35 "serwin35 (10 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (1 commits)")[![PaulKenya](https://avatars.githubusercontent.com/u/27075431?v=4)](https://github.com/PaulKenya "PaulKenya (1 commits)")[![TechTailor](https://avatars.githubusercontent.com/u/14147474?v=4)](https://github.com/TechTailor "TechTailor (1 commits)")

---

Tags

loglaravelAuthenticationnotification

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/serwin35-laravel-authentication-log/health.svg)

```
[![Health](https://phpackages.com/badges/serwin35-laravel-authentication-log/health.svg)](https://phpackages.com/packages/serwin35-laravel-authentication-log)
```

###  Alternatives

[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M531](/packages/laravel-passport)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)

PHPackages © 2026

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