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

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

yadahan/laravel-authentication-log
==================================

Laravel Authentication Log provides authentication logger and notification for Laravel.

v1.9.0(4mo ago)419677.7k↓35.9%56[5 issues](https://github.com/yadahan/laravel-authentication-log/issues)[3 PRs](https://github.com/yadahan/laravel-authentication-log/pulls)5MITPHPPHP ^7.2.5|^8.0CI failing

Since Sep 18Pushed 4mo ago4 watchersCompare

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

READMEChangelog (10)Dependencies (20)Versions (14)Used By (5)

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

[](#laravel-authentication-log)

[![Build Status](https://camo.githubusercontent.com/ef6a3f17e65d9c750bdfce5e7ba79a041607086667c47cd26d7dae63552b7f4c/68747470733a2f2f7472617669732d63692e6f72672f7961646168616e2f6c61726176656c2d61757468656e7469636174696f6e2d6c6f672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yadahan/laravel-authentication-log)[![StyleCI](https://camo.githubusercontent.com/15194344815961f289574a2b5285699550fa108e6a972a98c7fc282ec7de9d77/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130333932373634352f736869656c643f6272616e63683d6d6173746572267374796c653d666c6174)](https://styleci.io/repos/103927645)[![Quality Score](https://camo.githubusercontent.com/b3298ef77cc49c0fed8d893cddf4c4223bd9dcb0764780f4061fc16d11989a5b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7961646168616e2f6c61726176656c2d61757468656e7469636174696f6e2d6c6f672e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/yadahan/laravel-authentication-log)[![Total Downloads](https://camo.githubusercontent.com/baf74142bfcf09b38c91a1400621e27215b5e6f8e2b8e085c6ff12ccaa3f75c1/68747470733a2f2f706f7365722e707567782e6f72672f7961646168616e2f6c61726176656c2d61757468656e7469636174696f6e2d6c6f672f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/yadahan/laravel-authentication-log)[![GitHub license](https://camo.githubusercontent.com/f48f8d6cf609f5b181b9c3218a85175fe8a5809c7ea400347f39697a5d55065d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174)](https://raw.githubusercontent.com/yadahan/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 yadahan/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="Yadahan\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 Yadahan\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),
```

### 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

63

—

FairBetter than 99% of packages

Maintenance77

Regular maintenance activity

Popularity58

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 81.8% 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 ~257 days

Recently: every ~374 days

Total

13

Last Release

121d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.0

v1.6.0PHP ^7.2.5|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/78014421577122fe30272450747d773c44e88d3f697e13faf92d233d8a7b4880?d=identicon)[yadahan](/maintainers/yadahan)

---

Top Contributors

[![yakidahan](https://avatars.githubusercontent.com/u/7757560?v=4)](https://github.com/yakidahan "yakidahan (36 commits)")[![SamuelNitsche](https://avatars.githubusercontent.com/u/24483576?v=4)](https://github.com/SamuelNitsche "SamuelNitsche (3 commits)")[![npostman](https://avatars.githubusercontent.com/u/5596683?v=4)](https://github.com/npostman "npostman (1 commits)")[![bhavingajjar](https://avatars.githubusercontent.com/u/11258397?v=4)](https://github.com/bhavingajjar "bhavingajjar (1 commits)")[![TechTailor](https://avatars.githubusercontent.com/u/14147474?v=4)](https://github.com/TechTailor "TechTailor (1 commits)")[![PaulKenya](https://avatars.githubusercontent.com/u/27075431?v=4)](https://github.com/PaulKenya "PaulKenya (1 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (1 commits)")

---

Tags

authenticationlaravelnotificationsloglaravelAuthenticationnotification

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/cashier

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

2.6k29.9M146](/packages/laravel-cashier)[laravel/pulse

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

1.7k15.1M132](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)

PHPackages © 2026

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