PHPackages                             adaa/laravel-auth-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. adaa/laravel-auth-log

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

adaa/laravel-auth-log
=====================

Laravel Auth Log provides authentication logger and notification for Laravel.

1.1(4y ago)016MITPHPPHP ^7.3|^8.0

Since Feb 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/AdaaSystem/laravel-auth-log)[ Packagist](https://packagist.org/packages/adaa/laravel-auth-log)[ RSS](/packages/adaa-laravel-auth-log/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

Laravel Auth Log
================

[](#laravel-auth-log)

[![Build Status](https://camo.githubusercontent.com/5fc10511923fe7d83b10ef5c99f4982000f69667fd34ba98ca050ca9e77a5e36/68747470733a2f2f7472617669732d63692e636f6d2f4164616153797374656d2f6c61726176656c2d617574682d6c6f672e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/AdaaSystem/laravel-auth-log)[![StyleCI](https://camo.githubusercontent.com/a33c97af395191ff8b6cde7da62571a1c9ceb260497be1600bd4947fa15e372b/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3138383431393435362f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/188419456)

Laravel Auth Log is a package to automatically log all logins of your users. It can also send notifications when a successful login was made from an unknown device.

This package is a modified and extended version of .

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

[](#installation)

> Laravel Auth Log requires Laravel 5.8 or higher, and PHP 7.2+.

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

```
composer require adaa/laravel-auth-log

```

### Configuration

[](#configuration)

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

```
php artisan vendor:publish --provider="Adaa\AuthLog\AuthLogServiceProvider"

```

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

```
php artisan migrate

```

Finally, add the `AuthLogable` and `Notifiable` traits to your authenticatable model (by default, `App\User` model). These traits provides various methods to allow you to get common auth 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 Adaa\AuthLog\AuthLogable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

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

### 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 Auth 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/auth-log.php` configuration file to `false`:

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

### Clear old logs

[](#clear-old-logs)

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

```
php artisan auth-log:clear

```

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

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

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

[](#contributing)

Thank you for considering contributing to the Laravel Auth Log.

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Total

2

Last Release

1557d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/52e1887d3957b71cb8ecb77f797b84cbb375d0eccad2931b7104eee7f6b64d52?d=identicon)[Elteayb](/maintainers/Elteayb)

---

Tags

loglaravelAuthenticationnotification

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/adaa-laravel-auth-log/health.svg)

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

###  Alternatives

[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)[saasscaleup/laravel-log-alarm

Laravel log Alarm help you to set up alarm when errors occur in your system and send you a notification via Slack and email

27025.0k](/packages/saasscaleup-laravel-log-alarm)[hosmelq/laravel-logsnag

Integrate the power of LogSnag's real-time event tracking into your Laravel application.

237.9k](/packages/hosmelq-laravel-logsnag)

PHPackages © 2026

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