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

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

sureshinde/laravel-auth-checker
===============================

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

v3.0.1(2y ago)15MITPHPPHP ^8.0

Since Feb 20Pushed 2y agoCompare

[ Source](https://github.com/SureShinde/laravel-auth-checker)[ Packagist](https://packagist.org/packages/sureshinde/laravel-auth-checker)[ RSS](/packages/sureshinde-laravel-auth-checker/feed)WikiDiscussions master Synced yesterday

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

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

[](#laravel-auth-checker)

[![Build Status](https://camo.githubusercontent.com/72486adbca6af6312a64167c0ce4e178e32e62bc903a7c8aa08b4cbeb68a3e71/68747470733a2f2f7472617669732d63692e6f72672f737572657368696e64652f6c61726176656c2d617574682d636865636b65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sureshinde/laravel-auth-checker) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/4932a63905c63af7505ea36a4124d278d3bbf000e9d3888c1fdacbd9ca40d544/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f737572657368696e64652f6c61726176656c2d617574682d636865636b65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sureshinde/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)
- [Access Collected Data](#access-collected-data)
    - [Logins](#logins)
    - [Devices](#devices)
- [Events](#events)
- [Practical usage](#practical-usage)
- [Tests](#tests)
- [Contributors](#contributors)

Requirements
------------

[](#requirements)

- Laravel 9 to 10
- PHP 8.0 to 8.2

### Laravel support

[](#laravel-support)

VersionRelease102.19, 102.08, 91.76, 71.65.81.25.7, 5.61.1Installation
------------

[](#installation)

- Require it with Composer:

```
composer require sureshinde/laravel-auth-checker
```

- Add to your **User** model the `SureShinde\AuthChecker\Models\HasLoginsAndDevices` trait and the `SureShinde\AuthChecker\Interfaces\HasLoginsAndDevicesInterface` interface.

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

class User extends Authenticatable implements HasLoginsAndDevicesInterface
{
    use Notifiable, HasLoginsAndDevices;
}
```

- Publish migrations and migrate your database:

```
php artisan vendor:publish --tag=auth-checker
php artisan migrate
```

Note: Migrations are published in case you need to customize migration timestamps to integrate to your existing project.

Access collected data
---------------------

[](#access-collected-data)

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

### Logins

[](#logins)

```
// Your user model:
$logins = $user->logins;
// Output:
[
    [
        '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',
    ],
    // ... and more
]
```

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)

```
// Your user model:
$devices = $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
        ],
    ],
    // ... and more
]
```

Roadmap
-------

[](#roadmap)

- Log user authentication
- Collect IP addresses
- Collect devices
- Get user's login history
- Get devices history
- Capture failed logins
- Capture lockout logins
- Trust / Untrust devices
- Notify user when an unknown device log in

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.

Practical usage
---------------

[](#practical-usage)

Once the trait `HasLoginsAndDevices` is added to your `User` model, it is extended with these 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.

Tests
-----

[](#tests)

```
vendor/bin/phpunit
```

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

[](#contributors)

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

Licence
-------

[](#licence)

MIT

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.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 ~0 days

Total

2

Last Release

866d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/22d1dbfaf2ce97ba98c35622a4934da8be03881728a94bc2e7b51429ba58ce9e?d=identicon)[sureshinde](/maintainers/sureshinde)

---

Top Contributors

[![MarceauKa](https://avatars.githubusercontent.com/u/1665333?v=4)](https://github.com/MarceauKa "MarceauKa (58 commits)")[![michael-rubel](https://avatars.githubusercontent.com/u/37669560?v=4)](https://github.com/michael-rubel "michael-rubel (7 commits)")[![SureShinde](https://avatars.githubusercontent.com/u/229213?v=4)](https://github.com/SureShinde "SureShinde (4 commits)")[![adrianmejias](https://avatars.githubusercontent.com/u/1440288?v=4)](https://github.com/adrianmejias "adrianmejias (2 commits)")[![brunogaspar](https://avatars.githubusercontent.com/u/2285372?v=4)](https://github.com/brunogaspar "brunogaspar (2 commits)")[![danielboendergaard](https://avatars.githubusercontent.com/u/314877?v=4)](https://github.com/danielboendergaard "danielboendergaard (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

pluginlaravelcheckpackageAuthenticationuserlaravel-packagelaravel-pluginIPdevice

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[lab404/laravel-auth-checker

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

225167.3k2](/packages/lab404-laravel-auth-checker)[lab404/laravel-impersonate

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

2.3k18.6M64](/packages/lab404-laravel-impersonate)[rickycezar/laravel-jwt-impersonate

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

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

UI for 404labfr/laravel-impersonate

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

PHPackages © 2026

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