PHPackages                             jslmariano/basic-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. jslmariano/basic-authentication-log

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

jslmariano/basic-authentication-log
===================================

Laravel Authentication Log provides authentication logger and notification for Laravel.

00PHP

Since Sep 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jslmariano/basic-authentication-log)[ Packagist](https://packagist.org/packages/jslmariano/basic-authentication-log)[ RSS](/packages/jslmariano-basic-authentication-log/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#laravel-authentication-log)

[![Build Status](https://camo.githubusercontent.com/29cec977ce0c7c7de197b5cc3dc34e16bea65239f282e6ef6294f87171763595/68747470733a2f2f7472617669732d63692e6f72672f6a736c6d617269616e6f2f62617369632d61757468656e7469636174696f6e2d6c6f672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jslmariano/basic-authentication-log)[![StyleCI](https://camo.githubusercontent.com/15194344815961f289574a2b5285699550fa108e6a972a98c7fc282ec7de9d77/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130333932373634352f736869656c643f6272616e63683d6d6173746572267374796c653d666c6174)](https://styleci.io/repos/103927645)[![Quality Score](https://camo.githubusercontent.com/e376eb93f94432d938a87516da0d3b1bb7d51c62159285b7c019cb45d7043cc0/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6a736c6d617269616e6f2f62617369632d61757468656e7469636174696f6e2d6c6f672e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/jslmariano/basic-authentication-log)[![Total Downloads](https://camo.githubusercontent.com/6019a881dae1f6b4138b63fbe7400c803964c8d0c801ffc37f80251606bc2954/68747470733a2f2f706f7365722e707567782e6f72672f6a736c6d617269616e6f2f62617369632d61757468656e7469636174696f6e2d6c6f672f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/jslmariano/basic-authentication-log)[![GitHub license](https://camo.githubusercontent.com/f48f8d6cf609f5b181b9c3218a85175fe8a5809c7ea400347f39697a5d55065d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174)](https://raw.githubusercontent.com/jslmariano/basic-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 jslmariano/basic-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="Jslmariano\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 Jslmariano\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

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9111b7026dace950e8403c8345d96fb4689b4ad630ee0f49df5b2f08acde213?d=identicon)[jslmariano](/maintainers/jslmariano)

---

Top Contributors

[![jslmariano](https://avatars.githubusercontent.com/u/20830165?v=4)](https://github.com/jslmariano "jslmariano (2 commits)")

### Embed Badge

![Health badge](/badges/jslmariano-basic-authentication-log/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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