PHPackages                             makkinga/laravel-trusted-devices - 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. makkinga/laravel-trusted-devices

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

makkinga/laravel-trusted-devices
================================

Add trusted devices to your user models

1.3.2(3y ago)429MITPHPPHP ^8.1

Since Nov 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/makkinga/laravel-trusted-devices)[ Packagist](https://packagist.org/packages/makkinga/laravel-trusted-devices)[ Docs](https://github.com/makkinga/laravel-trusted-devices)[ RSS](/packages/makkinga-laravel-trusted-devices/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (14)Versions (12)Used By (0)

[![](https://github.com/makkinga/laravel-trusted-devices/raw/main/banner.png?raw=true)](https://github.com/makkinga/laravel-trusted-devices/blob/main/banner.png?raw=true)

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

[](#installation)

You can install the package via composer:

```
composer require makkinga/laravel-trusted-devices
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="trusted-devices-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="trusted-devices-config"
```

This is the contents of the published config file:

```
return [
    # Overwrite the auto detection of the guard
    'guard'      => null,

    # The layout to use for the views
    'layout'     => 'layouts.app',

    # The middleware to use for the routes
    'middleware' => ['web', 'auth'],

    # Automatically trust the first device
    'trust_first_device' => true
];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="trusted-devices-views"
```

### IpInfo

[](#ipinfo)

In order to make use of IpInfo.io's free 50k requests per month rate limit, add your API token to your .env:

```
TRUSTED_DEVICES_IPINFO_TOKEN="{your_token}"
```

Usage
-----

[](#usage)

Prepare your user model by adding the `HasTrustedDevices` trait and also make sure it is using the `Notifiable` trait:

```
use Illuminate\Notifications\Notifiable;
use Makkinga\TrustedDevices\Traits\HasTrustedDevices;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable, HasTrustedDevices;
}
```

Then add the trusted device middleware to your `$routeMiddleware` in `app/Http/Kernel.php`:

```
use Makkinga\TrustedDevices\Middleware\EnsureDeviceIsTrusted;

protected $routeMiddleware = [
    [...]
    'trusted' => EnsureDeviceIsTrusted::class,
];
```

You can now use the "trusted" middleware on your routes and route groups like this:

```
Route::middleware(['auth', 'trusted'])->group(function () {
    // Your routes
});
```

```
Route::get('/my-route', [MyController::class, 'method'])->name('my-route')->middleware('trusted');
```

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Gydo Makkinga](https://github.com/makkinga)

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~16 days

Recently: every ~0 days

Total

11

Last Release

1151d ago

Major Versions

0.2.2 → 1.0.02022-11-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/085809385b65e1d8a3981920c6a0e14f63744c7df9e5d58802c489698fa44f26?d=identicon)[makkinga](/maintainers/makkinga)

---

Top Contributors

[![makkinga](https://avatars.githubusercontent.com/u/3294611?v=4)](https://github.com/makkinga "makkinga (20 commits)")

---

Tags

laravelMakkingatrusted-devices

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/makkinga-laravel-trusted-devices/health.svg)

```
[![Health](https://phpackages.com/badges/makkinga-laravel-trusted-devices/health.svg)](https://phpackages.com/packages/makkinga-laravel-trusted-devices)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k37](/packages/spatie-laravel-passkeys)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M99](/packages/dedoc-scramble)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[filament/support

Core helper methods and foundation code for all Filament packages.

2331.0M244](/packages/filament-support)

PHPackages © 2026

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