PHPackages                             ibf/laravel-device-tracking - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ibf/laravel-device-tracking

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ibf/laravel-device-tracking
===========================

a library that allow to track different devices used

00PHP

Since Jan 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/iceberg55/laravel-device-tracking)[ Packagist](https://packagist.org/packages/ibf/laravel-device-tracking)[ RSS](/packages/ibf-laravel-device-tracking/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

A library that allows you to track different devices used per user
==================================================================

[](#a-library-that-allows-you-to-track-different-devices-used-per-user)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fcf33c60ec7838dbda3d80b92e3a423f57ea5eed8b1c02acaac9fb41c1496c62/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6976616e6f6d617474656f2f6c61726176656c2d6465766963652d747261636b696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ivanomatteo/laravel-device-tracking)

[![Total Downloads](https://camo.githubusercontent.com/94f69227ae89c7451b280f51823ef14996711f542b6c1e4b4adf0e862d255770/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6976616e6f6d617474656f2f6c61726176656c2d6465766963652d747261636b696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ivanomatteo/laravel-device-tracking)

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
------------

[](#installation)

You can install the package via composer:

```
composer require ivanomatteo/laravel-device-tracking

php artisan migrate
```

Publish config file:

```
php artisan vendor:publish --provider "IvanoMatteo\LaravelDeviceTracking\LaravelDeviceTrackingServiceProvider" --tag config
```

Usage
-----

[](#usage)

```
// add the trait to your user model
class User{
    //...
    use IvanoMatteo\LaravelDeviceTracking\Traits\UseDevices;
    //...
}

// call on login or when you want update and check the device informations
// by default this function is called when the Login event is fired
// only with the "web" auth guard
// if you want you can disable the detect_on_login option in the config file
$device = \DeviceTracker::detectFindAndUpdate();

// flag as verified for the current user
\DeviceTracker::flagCurrentAsVerified();

// flag as verified for a specific user
\DeviceTracker::flagAsVerified($device, $user_id);

// flag as verified for a specific user by device uuid
\DeviceTracker::flagAsVerifiedByUuid($device_uuid, $user_id);
```

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()-&gt;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

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information 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)

- [Ivano Matteo](https://github.com/ivanomatteo)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 86.2% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e8b0995d4a03e32c0d19f9f3278e85b94078f9122ad6f130e18e274878e26a9?d=identicon)[iceberg55](/maintainers/iceberg55)

---

Top Contributors

[![ivanomatteo](https://avatars.githubusercontent.com/u/35255310?v=4)](https://github.com/ivanomatteo "ivanomatteo (56 commits)")[![mikha-dev](https://avatars.githubusercontent.com/u/3321987?v=4)](https://github.com/mikha-dev "mikha-dev (4 commits)")[![hotmeteor](https://avatars.githubusercontent.com/u/378585?v=4)](https://github.com/hotmeteor "hotmeteor (1 commits)")[![snipe](https://avatars.githubusercontent.com/u/197404?v=4)](https://github.com/snipe "snipe (1 commits)")[![yurirnascimento](https://avatars.githubusercontent.com/u/4502631?v=4)](https://github.com/yurirnascimento "yurirnascimento (1 commits)")[![joseborges](https://avatars.githubusercontent.com/u/7250506?v=4)](https://github.com/joseborges "joseborges (1 commits)")[![iceberg55](https://avatars.githubusercontent.com/u/22175435?v=4)](https://github.com/iceberg55 "iceberg55 (1 commits)")

### Embed Badge

![Health badge](/badges/ibf-laravel-device-tracking/health.svg)

```
[![Health](https://phpackages.com/badges/ibf-laravel-device-tracking/health.svg)](https://phpackages.com/packages/ibf-laravel-device-tracking)
```

###  Alternatives

[whitehat101/apr1-md5

Apache's APR1-MD5 algorithm in pure PHP

349.9M10](/packages/whitehat101-apr1-md5)[buildix/timex

Calendar plugin for filamentphp

1277.6k](/packages/buildix-timex)[dan0sz/resource-hints-magento2

Add `&lt;link rel='preconnect'&gt;`, `&lt;link rel='dns-prefetch'&gt;`, `&lt;link rel='prefetch'&gt;`, or `&lt;link rel='preload'&gt;` resource hints to Magento 2's head.

21100.2k](/packages/dan0sz-resource-hints-magento2)[mihaeu/html-formatter

HTML Formatter pritifies HTML content by applying proper intendation (no tidy, purification, etc.).

1773.3k5](/packages/mihaeu-html-formatter)[raoul2000/yii-simple-workflow

A simple workflow engine for Yii 1

278.2k](/packages/raoul2000-yii-simple-workflow)[sun/country

Sun Country is the package that helps you to get the country name &amp; dialing code by the country ISO 3166-1 Alpha-2 code.

1016.8k](/packages/sun-country)

PHPackages © 2026

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