Download the PHP package publiux/laravel-authentication-log without Composer
On this page you can find all versions of the php package publiux/laravel-authentication-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download publiux/laravel-authentication-log
More information about publiux/laravel-authentication-log
Files in publiux/laravel-authentication-log
Package laravel-authentication-log
Short Description Log user authentication details and send new device notifications.
License MIT
Homepage https://github.com/rappasoft/laravel-authentication-log
Informations about the package laravel-authentication-log

Laravel Authentication Log is a comprehensive package which tracks your user's authentication information such as login/logout time, IP, Browser, Location, Device Fingerprint, etc. It sends out notifications via mail, slack, or SMS for new devices and failed logins, detects suspicious activity, provides session management, prevents duplicate log entries from session restorations, and much more.
Version 6.0.0 introduces major enhancements including session restoration prevention, improved device fingerprinting, enhanced statistics, and more. See the Release Notes for complete details.
Features
Core Features
- ✅ Authentication Logging - Tracks all login/logout attempts with IP, user agent, location, and timestamps
- ✅ Device Fingerprinting - Reliable device identification using SHA-256 hashing with browser version normalization (prevents false positives)
- ✅ New Device Detection - Automatically detects and notifies users of new device logins
- ✅ Failed Login Tracking - Logs and optionally notifies users of failed login attempts
- ✅ Location Tracking - Optional GeoIP integration for location data
- ✅ Session Restoration Prevention - Automatically prevents duplicate log entries from page refreshes and remember me cookies
Advanced Features
- 🔒 Suspicious Activity Detection - Automatically detects multiple failed logins, rapid location changes, and unusual login times
- 📊 Statistics & Insights - Get comprehensive login statistics including total logins, failed attempts, unique devices, and more
- 🔐 Session Management - View active sessions, revoke specific sessions, or logout all other devices
- 🛡️ Device Trust Management - Mark devices as trusted, manage device names, and require trusted devices for sensitive actions
- ⚡ Rate Limiting - Prevents notification spam with configurable rate limits
- 🔔 Webhook Support - Send webhooks to external services for authentication events
- 📤 Export Functionality - Export authentication logs to CSV or JSON format
- 🎯 Query Scopes - Powerful query scopes for filtering logs (successful, failed, suspicious, recent, by IP, by device, etc.)
- 🚦 Middleware - Protect routes with trusted device middleware
Documentation, Installation, and Usage Instructions
See the documentation for detailed installation and usage instructions.
Version Compatibility
| Laravel | Authentication Log | Features |
|---|---|---|
| 8.x | 1.x | Basic logging only |
| 9.x | 2.x | Basic logging only |
| 10.x | 3.x | Basic logging only |
| 11.x | 5.x, 6.x | All features (device fingerprinting, suspicious activity, webhooks, session management, etc.) |
| 12.x | 5.x, 6.x | All features (device fingerprinting, suspicious activity, webhooks, session management, etc.) |
Note: Version 6.x requires Laravel 11.x or 12.x and PHP 8.1+. Version 5.x also supports Laravel 11.x and 12.x. For Laravel 10.x support, please use version 3.x.
Installation
Quick Start
1. Add the Trait to Your User Model
2. Publish and Run Migrations
For new installations:
For existing installations (upgrading from v5.x or earlier):
Important: If upgrading from v3.x or earlier, the upgrade migration will safely add the new columns (device_id, device_name, is_trusted, last_activity_at, is_suspicious, suspicious_reason) to your existing authentication_log table without affecting existing data.
Breaking Changes in v6.0.0:
- Laravel 10.x support has been dropped (only Laravel 11.x and 12.x are supported)
- PHP 8.1+ is now required
- See the Upgrade Guide for detailed migration instructions
3. Configure (Optional)
Usage Examples
Get User Statistics
Session Management
Device Management
Query Scopes
Suspicious Activity Detection
Middleware for Trusted Devices
Export Logs
Webhook Configuration
Add webhooks to your config/authentication-log.php:
Configuration
The package includes comprehensive configuration options:
- Notifications - Configure new device and failed login notifications with rate limiting
- Suspicious Activity - Configure thresholds and detection rules
- Webhooks - Set up webhook endpoints for external integrations
- Database - Customize table name and database connection
- Session Restoration - Configure session restoration prevention (prevents duplicate log entries)
- New User Threshold - Configure time window for new user detection
See the configuration documentation for all available options.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Anthony Rappa
- yadahan/laravel-authentication-log
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-authentication-log with dependencies
illuminate/contracts Version ^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.4.3