Download the PHP package sureshinde/laravel-auth-checker without Composer
On this page you can find all versions of the php package sureshinde/laravel-auth-checker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sureshinde/laravel-auth-checker
More information about sureshinde/laravel-auth-checker
Files in sureshinde/laravel-auth-checker
Package laravel-auth-checker
Short Description Laravel Auth Checker allows you to log users authentication, devices authenticated from and lock intrusions.
License MIT
Informations about the package laravel-auth-checker
Laravel Auth Checker
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.
- Requirements
- Installation
- Access Collected Data
- Logins
- Devices
- Events
- Practical usage
- Tests
- Contributors
Requirements
- Laravel 9 to 10
- PHP 8.0 to 8.2
Laravel support
| Version | Release |
|---|---|
| 10 | 2.1 |
| 9, 10 | 2.0 |
| 8, 9 | 1.7 |
| 6, 7 | 1.6 |
| 5.8 | 1.2 |
| 5.7, 5.6 | 1.1 |
Installation
-
Require it with Composer:
-
Add to your User model the
SureShinde\AuthChecker\Models\HasLoginsAndDevicestrait and theSureShinde\AuthChecker\Interfaces\HasLoginsAndDevicesInterfaceinterface. - Publish migrations and migrate your database:
Note: Migrations are published in case you need to customize migration timestamps to integrate to your existing project.
Access collected data
This library collects login data and devices data about your users.
Logins
Also, you can directly access logins by their type:
$user->auths, returns successful logins (viaLogin::TYPE_LOGIN)$user->fails, returns failed logins (viaLogin::TYPE_FAILED)$user->lockouts, returns locked out logins (viaLogin::TYPE_LOCKOUT)
Devices
Roadmap
- [x] Log user authentication
- [x] Collect IP addresses
- [x] Collect devices
- [x] Get user's login history
- [x] Get devices history
- [x] Capture failed logins
- [x] Capture lockout logins
- [ ] Trust / Untrust devices
- [ ] Notify user when an unknown device log in
Events
There are many events available that can be used to add features to your app:
LoginCreatedis fired when a user authenticates.DeviceCreatedis fired when a new device is created for a user.FailedAuthis fired when a user fails to log in.LockoutAuthis 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
Once the trait HasLoginsAndDevices is added to your User model, it is extended with these methods:
logins()returns all loginsauths()returns all successful login attempsfails()returns all failed login attemptslockouts()returns all lockouts
Each login returned is associated with the Device model used.
devices()returns all devices used by the user to authenticate.
Tests
Contributors
- MarceauKa
- and all others contributors
Licence
MIT
All versions of laravel-auth-checker with dependencies
laravel/framework Version ^10.0
sureshinde/mobile-desktop-detect Version ^3.0
