PHPackages                             lab404/laravel-auth-checker - 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. lab404/laravel-auth-checker

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

lab404/laravel-auth-checker
===========================

Laravel Auth Checker allows you to log users authentication, devices authenticated from and lock intrusions.

3.0.0(1y ago)223164.9k↓12.8%36[6 issues](https://github.com/404labfr/laravel-auth-checker/issues)[1 PRs](https://github.com/404labfr/laravel-auth-checker/pulls)2MITPHPPHP ^8.2

Since Mar 28Pushed 1y ago12 watchersCompare

[ Source](https://github.com/404labfr/laravel-auth-checker)[ Packagist](https://packagist.org/packages/lab404/laravel-auth-checker)[ RSS](/packages/lab404-laravel-auth-checker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (21)Used By (2)

Laravel Auth Checker
====================

[](#laravel-auth-checker)

[![Build Status](https://camo.githubusercontent.com/807cf758fc71eb23ae7b1f9bd0fd76b39e59e9161d51fa8596321e8ced46e5f5/68747470733a2f2f7472617669732d63692e6f72672f3430346c616266722f6c61726176656c2d617574682d636865636b65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/404labfr/laravel-auth-checker) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/b0d42afa0a786c0cf28b64c326bb5e082cf0eaf41c26fc41f4e13c0a98438a07/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f3430346c616266722f6c61726176656c2d617574682d636865636b65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/404labfr/laravel-auth-checker/?branch=master)

**Laravel Auth Checker** is a plugin to **collect login info** and **devices** used when a **user authenticates**. It makes it easy to **catch user authentication attempts and lockouts** from **new IP address** or **new devices**.

[![Example logins table](screenshot.png?raw=true)](screenshot.png?raw=true)

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
    - [Authenticatable model](#authenticatable-model)
    - [Logins](#logins)
    - [Devices](#devices)
    - [Events](#events)
- [Tests](#tests)
- [Contributors](#contributors)
- [Licence](#licence)

### Requirements

[](#requirements)

VersionRelease11[3.0](https://github.com/404labfr/laravel-auth-checker/tree/3.0.0)9, 10[2.0](https://github.com/404labfr/laravel-auth-checker/tree/2.0.0)8, 9[1.7](https://github.com/404labfr/laravel-auth-checker/tree/1.7.0)6, 7[1.6](https://github.com/404labfr/laravel-auth-checker/tree/1.6.2)Installation
------------

[](#installation)

- Require the package: `composer require lab404/laravel-auth-checker`
- Publish migration files: `php artisan vendor:publish --tag=auth-checker`
- Migrate your database: `php artisan migrate`
- Configure your `Authenticatable` model (see below)

Usage
-----

[](#usage)

This library collects login data and devices data about your users.

### Authenticatable model

[](#authenticatable-model)

Your `Authenticatable` model (usually `User`) must implement the `HasLoginsAndDevicesInterface` interface.

The trait `HasLoginsAndDevices` is provided with for a working default implementation.

```
use Lab404\AuthChecker\Models\HasLoginsAndDevices;
use Lab404\AuthChecker\Interfaces\HasLoginsAndDevicesInterface;

class User extends Authenticatable implements HasLoginsAndDevicesInterface
{
    // ...
    use HasLoginsAndDevices;
}
```

Once configured, you can access the following methods

- `logins()` returns all logins
- `auths()` returns all successful login attemps
- `fails()` returns all failed login attempts
- `lockouts()` returns all lockouts

Each login returned is associated with the `Device` model used

- `devices()` returns all devices used by the user to authenticate.

### Logins

[](#logins)

Calling `$user->logins` outputs:

```
[
    [
        'ip_address' => '1.2.3.4',
        'device_id' => 1, // ID of the used device
        'type' => 'auth',
        'device' => [
            // See Devices
        ],
        'created_at' => '2017-03-25 11:42:00',
    ],
    // ...
]
```

Also, you can directly access logins by their type

- `$user->auths`, returns successful logins (via `Login::TYPE_LOGIN`)
- `$user->fails`, returns failed logins (via `Login::TYPE_FAILED`)
- `$user->lockouts`, returns locked out logins (via `Login::TYPE_LOCKOUT`)

### Devices

[](#devices)

Calling `$user->devices` outputs:

```
[
    [
        'platform' => 'OS X',
        'platform_version' => '10_12_2',
        'browser' => 'Chrome',
        'browser_version' => '54',
        'is_desktop' => true,
        'is_mobile' => false,
        'language' => 'fr-fr',
        'login' => [
          // See logins
        ],
    ],
    // ...
]
```

### Events

[](#events)

There are many events available that can be used to add features to your app

- `LoginCreated` is fired when a user authenticates.
- `DeviceCreated` is fired when a new device is created for a user.
- `FailedAuth` is fired when a user fails to log in.
- `LockoutAuth` is fired when authentication is locked for a user (too many attempts).

Each event passes a `Login` model and a `Device` model to your listeners.

Tests
-----

[](#tests)

```
vendor/bin/phpunit
```

Contributors
------------

[](#contributors)

- [MarceauKa](https://github.com/MarceauKa)
- and all others [contributors](https://github.com/404labfr/laravel-auth-checker/graphs/contributors)

Licence
-------

[](#licence)

MIT

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 72.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 ~137 days

Recently: every ~334 days

Total

20

Last Release

729d ago

Major Versions

1.7.0 → 2.0.02023-02-10

2.0.0 → 3.0.02024-05-19

PHP version history (6 changes)1.2.0PHP ^7.1.3

1.3.0PHP ^7.2

1.6.0PHP &gt;=7.2

1.7.0PHP ^7.3|^8.0

2.0.0PHP ^8.0

3.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1665333?v=4)[Marceau Casals](/maintainers/MarceauKa)[@MarceauKa](https://github.com/MarceauKa)

---

Top Contributors

[![MarceauKa](https://avatars.githubusercontent.com/u/1665333?v=4)](https://github.com/MarceauKa "MarceauKa (59 commits)")[![michael-rubel](https://avatars.githubusercontent.com/u/37669560?v=4)](https://github.com/michael-rubel "michael-rubel (7 commits)")[![danielboendergaard](https://avatars.githubusercontent.com/u/314877?v=4)](https://github.com/danielboendergaard "danielboendergaard (2 commits)")[![adrianmejias](https://avatars.githubusercontent.com/u/1440288?v=4)](https://github.com/adrianmejias "adrianmejias (2 commits)")[![gboquizosanchez](https://avatars.githubusercontent.com/u/20032391?v=4)](https://github.com/gboquizosanchez "gboquizosanchez (2 commits)")[![brunogaspar](https://avatars.githubusercontent.com/u/2285372?v=4)](https://github.com/brunogaspar "brunogaspar (2 commits)")[![acharkizakaria](https://avatars.githubusercontent.com/u/6684599?v=4)](https://github.com/acharkizakaria "acharkizakaria (1 commits)")[![Vendin](https://avatars.githubusercontent.com/u/9011975?v=4)](https://github.com/Vendin "Vendin (1 commits)")[![drbyte](https://avatars.githubusercontent.com/u/404472?v=4)](https://github.com/drbyte "drbyte (1 commits)")[![guanguans](https://avatars.githubusercontent.com/u/22309277?v=4)](https://github.com/guanguans "guanguans (1 commits)")[![lex111](https://avatars.githubusercontent.com/u/4408379?v=4)](https://github.com/lex111 "lex111 (1 commits)")[![mstaack](https://avatars.githubusercontent.com/u/10169509?v=4)](https://github.com/mstaack "mstaack (1 commits)")[![SiebeVE](https://avatars.githubusercontent.com/u/14889418?v=4)](https://github.com/SiebeVE "SiebeVE (1 commits)")

---

Tags

authcontrollaravellaravel-packagepluginlaravelcheckpackageAuthenticationuserlaravel-packagelaravel-pluginIPdevice

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lab404-laravel-auth-checker/health.svg)

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

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[rickycezar/laravel-jwt-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

24117.6k](/packages/rickycezar-laravel-jwt-impersonate)[hapidjus/laravel-impersonate-ui

UI for 404labfr/laravel-impersonate

371.5k](/packages/hapidjus-laravel-impersonate-ui)

PHPackages © 2026

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