Download the PHP package jeffersonsimaogoncalves/laravel-device-tracking without Composer
On this page you can find all versions of the php package jeffersonsimaogoncalves/laravel-device-tracking. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeffersonsimaogoncalves/laravel-device-tracking
More information about jeffersonsimaogoncalves/laravel-device-tracking
Files in jeffersonsimaogoncalves/laravel-device-tracking
Package laravel-device-tracking
Short Description a library that allow to track different devices used
License MIT
Homepage https://github.com/jeffersonsimaogoncalves/laravel-device-tracking
Informations about the package laravel-device-tracking
A library that allows you to track different devices used per user
This package implements a "google like" device detection.
You can detect when a user is using a new device and manage the verified status between user and device.
You can also detect a possible device hijacking.
Installation
You can install the package via composer:
Publish config file:
Usage
If you are using Session Authentication it's possible to add the middleware IvanoMatteo\LaravelDeviceTracking\Http\Middleware\DeviceTrackerMiddleware in app/Http/Kernel.php, at the end of web group.
This way, the device will also be checked for subsequents requests to the login request. DeviceTrackerMiddleware will store the md5(request()->ip() . $device_uuid . $user_agent ) inside the session so the detection will be executed again only if the hash does not match.
Following events can be emitted:
-
DeviceCreated
when a new device is detected and stored
-
DeviceUpdated
when some information of a device is changed
-
DeviceHijacked
when critical device information is changed. You can also define a custom DeviceHijackingDetector. After this event, the device will be updated, and the next time, DeviceHijacked will not be emitted, but the device will have the field device_hijacked_at with the last DeviceHijacked event timestamp.
-
UserSeenFromNewDevice
when a user is detected on a device for the first time
-
UserSeenFromUnverifiedDevice
when a user is detected on a device not for the first time and the device is not flagged as verified
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Ivano Matteo
- Ivano Matteo
- All Contributors
License
The MIT License (MIT). Please see License File for more information.