PHPackages                             salfade/laravel-login-tracker - 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. salfade/laravel-login-tracker

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

salfade/laravel-login-tracker
=============================

A simple package to track users successful login attempts

0.0.8(6mo ago)42.1k3MITPHPPHP ^7.3|^7.4|^8.0|^8.1|^8.2|^8.3|^8.4

Since Jun 12Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/salfade/laravel-login-tracker)[ Packagist](https://packagist.org/packages/salfade/laravel-login-tracker)[ Docs](https://github.com/spatie/laravel-login-tracker)[ RSS](/packages/salfade-laravel-login-tracker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (5)Versions (10)Used By (0)

A simple package to track login attempts
========================================

[](#a-simple-package-to-track-login-attempts)

[![Latest Version on Packagist](https://camo.githubusercontent.com/767856c5b7e06804943d6fa5a57668a7f730f050b9bd51b43a5e1f7e2e1a7042/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616c666164652f6c61726176656c2d6c6f67696e2d747261636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/salfade/laravel-login-tracker)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d4acdaa2cacbee59c45115b09159d5f38f5f14012a08d4d4384ef0cdda05dc61/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f73616c666164652f6c61726176656c2d6c6f67696e2d747261636b65722f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/salfade/laravel-login-tracker/actions?query=workflow%3Arun-tests+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/8489097fe73e172609e2fbafd64cd32bd4ad407b878d7f946a14ae7f45b59848/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616c666164652f6c61726176656c2d6c6f67696e2d747261636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/salfade/laravel-login-tracker)

This simple package let's you track your user login activity. Track their IPs to give you better visibility to see user activity.

Support us
----------

[](#support-us)

[Buy us Coffee?](http://paypal.me/MohamedFawzan)

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

[](#installation)

```
composer require salfade/laravel-login-tracker
```

Publish and run the migrations with:

```
php artisan vendor:publish --provider="Salfade\LoginTracker\LoginTrackerServiceProvider" --tag="migrations"
php artisan migrate
```

Next, add the `Salfade\LoginTracker\Traits\HasLoginAttempts` trait to your `User` Model.

```
    use Salfade\LoginTracker\Traits\HasLoginAttempts;
```

Usage
-----

[](#usage)

Retrieving the latest successful login attempt

```
$userLastSuccessfulLogin = User::find($id)->latestLoginAttempt();
echo $userLastSuccessfulLogin->ip_address;
echo $userLastSuccessfulLogin->created_at;
```

Retrieving all the successful login attempts

```
$userLastSuccessfulLogin = User::find($id)->loginAttempts();
```

Retrieving the IP address of last successful login attempt

```
$userLastSuccessfulLogin = User::find($id)->lastLoginIp();
```

Retrieving the timestamp of last successful login attempt

```
$userLastSuccessfulLogin = User::find($id)->lastLoginDate();
```

Retrieving the human friendly date for last successful login attempt

```
$userLastSuccessfulLogin = User::find($id)->lastLoginDateForHuman();
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Mohamed Fawzan](https://github.com/fawzanm)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance77

Regular maintenance activity

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 96.3% 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 ~394 days

Recently: every ~492 days

Total

6

Last Release

198d ago

PHP version history (3 changes)0.0.3PHP ^7.4

0.0.7PHP ^7.3

0.0.8PHP ^7.3|^7.4|^8.0|^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

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

---

Top Contributors

[![fawzanm](https://avatars.githubusercontent.com/u/2080551?v=4)](https://github.com/fawzanm "fawzanm (26 commits)")[![irfanm96](https://avatars.githubusercontent.com/u/42065936?v=4)](https://github.com/irfanm96 "irfanm96 (1 commits)")

---

Tags

hacktoberfestlaravelnotificationpushyspatielaravel-login-tracker

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/salfade-laravel-login-tracker/health.svg)

```
[![Health](https://phpackages.com/badges/salfade-laravel-login-tracker/health.svg)](https://phpackages.com/packages/salfade-laravel-login-tracker)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[spatie/laravel-welcome-notification

Send a welcome notification to new users

597702.1k9](/packages/spatie-laravel-welcome-notification)[spatie/laravel-login-link

Quickly login to your local environment

4381.2M1](/packages/spatie-laravel-login-link)[spatie/laravel-passkeys

Use passkeys in your Laravel app

444494.4k16](/packages/spatie-laravel-passkeys)[spatie/laravel-one-time-passwords

Use one-time passwords (OTP) to authenticate in your Laravel app

170223.1k3](/packages/spatie-laravel-one-time-passwords)[spatie/laravel-authorize

A middleware to check authorization

20125.8k1](/packages/spatie-laravel-authorize)

PHPackages © 2026

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