PHPackages                             erayaydin/fingerprint-laravel - 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. erayaydin/fingerprint-laravel

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

erayaydin/fingerprint-laravel
=============================

Fingerprint Laravel Wrapper

0.1.0(1y ago)376[5 PRs](https://github.com/erayaydin/fingerprint-laravel/pulls)MITPHPPHP ^8.2CI passing

Since Sep 25Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/erayaydin/fingerprint-laravel)[ Packagist](https://packagist.org/packages/erayaydin/fingerprint-laravel)[ Docs](https://github.com/erayaydin/fingerprint-laravel)[ GitHub Sponsors](https://github.com/erayaydin)[ RSS](/packages/erayaydin-fingerprint-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (17)Versions (7)Used By (0)

Fingerprint Laravel
===================

[](#fingerprint-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/dd45e33d2a974c9ada60a56ac0dcb67b4f23e242e6cc80702dd6a85a001fdac4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65726179617964696e2f66696e6765727072696e742d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/erayaydin/fingerprint-laravel)[![GitHub Tests Action Status](https://camo.githubusercontent.com/84930dcd27137b528b9c56e893ae1aa6c5060c06b46261ec650be2bdf98f27ea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f65726179617964696e2f66696e6765727072696e742d6c61726176656c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/erayaydin/fingerprint-laravel/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/880467d87485ef1afc1c566cc99de7b6409e5b76e684c395dfec08de0b183613/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f65726179617964696e2f66696e6765727072696e742d6c61726176656c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/erayaydin/fingerprint-laravel/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/1b3af1c0434f257fc2468fadc50317040c6d75b92a1d55ea4e23f18af5b19287/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65726179617964696e2f66696e6765727072696e742d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/erayaydin/fingerprint-laravel)[![Test Coverage](https://raw.githubusercontent.com/erayaydin/fingerprint-laravel/main/badge-coverage.svg)](https://packagist.org/packages/erayaydin/fingerprint-laravel)

Fingerprint Laravel is a package for integrating Fingerprint Server API into your Laravel application with [PHP SDK for Fingerprint Pro Server API](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk). It provides HTTP middlewares to block bots, VPNs, Tor, and more based on Fingerprint Server API event response.

Requirements
------------

[](#requirements)

- **Laravel 11**
- **PHP ^8.2**

Features
--------

[](#features)

- Customizable implementations with `fingerprint` config file.
- Injectable `Event` and `Fingerprint` classes. `Event` data class will auto-bind when a request with `requestId`received.
- `Fingerprint` class provides a fluent interface to interact with the Fingerprint Server API.
- Ready to use HTTP middlewares to block bots, VPNs, Tor, and more based on Fingerprint Server API event response.

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

[](#installation)

You can install the package via Composer:

```
$ composer require erayaydin/fingerprint-laravel
```

Check installation with about command.

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
$ php artisan vendor:publish --tag=fingerprint-config
```

This will create a config/fingerprint.php file where you can set configurations.

> By default, the package will use the `FINGERPRINT_PRO_SECRET_API_KEY` and `FINGERPRINT_REGION` environment variables. You should specify these values in your `.env` file. You can change the environment variable names in the configuration file after publishing it.

### Configuration Options

[](#configuration-options)

- **api\_secret**: Your Fingerprint Server API key.
- **region**: The region of the Fingerprint Server API. Available options: `eu`/`europe`, `ap`/`asia`, `global`.
- **middleware**
    - **bot\_block**: Blocks good and/or bad bots.
    - **vpn\_block**: Blocks request if user is using a VPN.
    - **tor\_block**: Blocks tor network users.
    - **min\_confidence**: Minimum required confidence score. It should be in range of 0.0 to 1.0. If it's null, it will not check the confidence score.
    - **incognito\_block**: Blocks users who are using incognito mode.
    - **max\_elapsed\_time**: Maximum elapsed time between the request and the event identification.

Usage
-----

[](#usage)

### Middlewares

[](#middlewares)

The package provides several middleware to block different types of traffics:

- BlockBotsMiddleware (`fingerprint.bots`)
- BlockIncognitoMiddleware (`fingerprint.incognito`)
- BlockOldIdentificationMiddleware (`fingerprint.old-identification`)
- BlockTorMiddleware (`fingerprint.tor`)
- BlockVPNMiddleware (`fingerprint.vpn`)
- MinConfidenceScoreMiddleware (`fingerprint.confidence`)

You can register these middleware in your `bootstrap/app.php` file or use the provided middleware group `fingerprint` in routes or controllers.

To use the middleware group in a route:

```
Route::middleware(['fingerprint'])->group(function () {
    // Request is valid!
});
```

Or you can use specific middlewares:

```
Route::middleware(['fingerprint.incognito', 'fingerprint.vpn'])->group(function () {
    // User is not in incognito mode and not using VPN!
});
```

### Event Data Access

[](#event-data-access)

Use dependency injection to access the `Event` data class in your controller or middleware:

```
class ExampleController extends Controller
{
    public function store(Event $event)
    {
        ray($event->identification, $event->botD, $event->isTor, $event->isVPN);
    }
}
```

### Fingerprint Server API Access

[](#fingerprint-server-api-access)

Use dependency injection to access the `Fingerprint` class in your controller or middleware:

```
class ExampleController extends Controller
{
    public function store(Fingerprint $fingerprint)
    {
        ray($fingerprint->getEvent('requestId'));
    }
}
```

### About Command Support

[](#about-command-support)

The package integrates with Laravel's `AboutCommand` to provide information about the fingerprinting configuration. This is registered automatically.

```
$ php artisan about
...
  Fingerprint Laravel .........................................................
  API Key ...................................................... Not Configured
  Bot Block ................................................ Enabled (Bad Bots)
  Incognito Block ..................................................... Enabled
  Min. Confidence ......................................................... 0.8
  Old Identification ............................................... 10 seconds
  Region ................................................................... eu
  TOR Block ............................................. Enabled (if signaled)
  VPN Block ........................................................... Enabled
  Version ................................................ 1.0.0+no-version-set
```

Testing
-------

[](#testing)

You can run the tests with:

```
composer test
```

Roadmap
-------

[](#roadmap)

- Increase code coverage to ~95%.
- Add config option to change `requestId` key.
- Add IP block middleware.
- Add auto visitor store support with `Visitor` model and migrations.
- Add `HasVisitorId` trait to use with custom Eloquent models.

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

[](#contributing)

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

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance55

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

594d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b287274d7b21f57cbb7341e0e18e824a19f449126dcee6c1f31b55c3636a41f?d=identicon)[erayaydin](/maintainers/erayaydin)

---

Top Contributors

[![erayaydin](https://avatars.githubusercontent.com/u/5854916?v=4)](https://github.com/erayaydin "erayaydin (11 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/erayaydin-fingerprint-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/erayaydin-fingerprint-laravel/health.svg)](https://phpackages.com/packages/erayaydin-fingerprint-laravel)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)[beyondcode/laravel-favicon

Create dynamic favicons based on your environment settings.

37345.5k](/packages/beyondcode-laravel-favicon)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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