PHPackages                             gatekeepr/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. gatekeepr/laravel

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

gatekeepr/laravel
=================

Laravel middleware and client helpers for Gatekeepr signup and login abuse protection.

00PHP

Since May 15Pushed 2mo agoCompare

[ Source](https://github.com/gtkppr/laravel)[ Packagist](https://packagist.org/packages/gatekeepr/laravel)[ RSS](/packages/gatekeepr-laravel/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

gatekeepr/laravel
=================

[](#gatekeeprlaravel)

Laravel middleware and client helpers for checking signup and login requests with Gatekeepr before accounts, credits, or sessions are created.

Install
-------

[](#install)

```
composer require gatekeepr/laravel
```

Publish the config when you want to customize defaults:

```
php artisan vendor:publish --tag=gatekeepr-config
```

Set your API key:

```
GATEKEEPR_API_KEY=your_gatekeepr_api_key
```

Middleware
----------

[](#middleware)

The package registers a `gatekeepr` middleware alias. Put it before the code that creates users or sessions.

```
use App\Http\Controllers\Auth\RegisteredUserController;
use Illuminate\Support\Facades\Route;

Route::post('/register', [RegisteredUserController::class, 'store'])
	->middleware('gatekeepr');
```

By default, only Gatekeepr `block` decisions are rejected. To reject challenges too:

```
Route::post('/login', [AuthenticatedSessionController::class, 'store'])
	->middleware('gatekeepr:block,challenge');
```

Blocked requests return JSON like:

```
{
	"error": "gatekeepr_blocked",
	"message": "Request blocked by Gatekeepr.",
	"status": "block",
	"threats": ["email_disposable"]
}
```

Manual Checks
-------------

[](#manual-checks)

```
use Gatekeepr\Laravel\Facades\Gatekeepr;
use Illuminate\Http\Request;

Route::post('/register', function (Request $request) {
	$decision = Gatekeepr::checkRequest($request);

	if ($decision->blocked()) {
		return response()->json($decision->responseBody(), $decision->responseStatus());
	}

	// Create the user.
});
```

Payload Extraction
------------------

[](#payload-extraction)

The package sends:

- `email` from request input fields `email`, `username`, or `user.email`, then route params, then the authenticated user.
- `ip` from common proxy headers, then Laravel's `$request->ip()`.
- `user_agent` from `$request->userAgent()`.

Customize extraction in `config/gatekeepr.php`:

```
'email_fields' => ['email', 'login'],
'email_sources' => ['input'],
'reject_statuses' => ['block', 'challenge'],
'block_message' => 'Signup blocked by Gatekeepr.',
```

For one-off calls:

```
$decision = Gatekeepr::checkRequest($request, [
	'get_email' => fn (Request $request) => $request->input('account.email'),
	'get_ip' => fn (Request $request) => $request->ip(),
	'get_user_agent' => fn (Request $request) => $request->userAgent(),
]);
```

Direct Client
-------------

[](#direct-client)

```
use Gatekeepr\Laravel\GatekeeprClient;

$client = new GatekeeprClient(config('gatekeepr.api_key'));

$result = $client->check([
	'email' => 'user@example.com',
	'ip' => request()->ip(),
	'user_agent' => request()->userAgent(),
]);
```

Testing
-------

[](#testing)

```
composer install
composer test
```

###  Health Score

18

—

LowBetter than 7% of packages

Maintenance57

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e38246aa358c6b741e52265b164c09f32dafe31fb9556ccae98bf5a9f0d4f275?d=identicon)[suciudan](/maintainers/suciudan)

---

Top Contributors

[![suciudan](https://avatars.githubusercontent.com/u/1799877?v=4)](https://github.com/suciudan "suciudan (1 commits)")

### Embed Badge

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

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

###  Alternatives

[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)[firemultimedia/mautic-multi-captcha-bundle

This plugin brings Google's reCAPTCHA, hCaptcha, and Cloudflare Turnstile integration to mautic.

141.3k](/packages/firemultimedia-mautic-multi-captcha-bundle)

PHPackages © 2026

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