PHPackages                             spatie/laravel-littlegatekeeper - 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. [Security](/categories/security)
4. /
5. spatie/laravel-littlegatekeeper

ActiveLibrary[Security](/categories/security)

spatie/laravel-littlegatekeeper
===============================

Protect pages from access with a universal username/password

2.0.6(2mo ago)19151.2k↑14.3%20[1 PRs](https://github.com/spatie/laravel-littlegatekeeper/pulls)1MITPHPPHP ^8.2CI passing

Since Jun 11Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/spatie/laravel-littlegatekeeper)[ Packagist](https://packagist.org/packages/spatie/laravel-littlegatekeeper)[ Docs](https://github.com/spatie/laravel-littlegatekeeper)[ Fund](https://spatie.be/open-source/support-us)[ GitHub Sponsors](https://github.com/spatie)[ RSS](/packages/spatie-laravel-littlegatekeeper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (15)Used By (1)

laravel-littlegatekeeper
========================

[](#laravel-littlegatekeeper)

[![Latest Version on Packagist](https://camo.githubusercontent.com/914e08b003c6f78ae3a56df526063d5a030229258999cc3fba770c8ab6939ad0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d6c6974746c65676174656b65657065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-littlegatekeeper)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![run-tests](https://github.com/spatie/laravel-littlegatekeeper/actions/workflows/run-tests.yml/badge.svg)](https://github.com/spatie/laravel-littlegatekeeper/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/0484e4c1f3f9fd8230ce33a54fd8d2b206d489abeb19d078fed4d6a36d861f66/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d6c6974746c65676174656b65657065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-littlegatekeeper)

Protect pages from access with a universal username/password combination (set by configuration).

Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/a51d2943d835d9e787db213334e7402202666e7bff8ea4a30395632cb7f4c5a9/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d6c6974746c65676174656b65657065722e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-littlegatekeeper)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Postcardware
------------

[](#postcardware)

You're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it makes it to your production environment you are required to send us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

The best postcards will get published on the open source page on our website.

Install
-------

[](#install)

You can install the package via Composer:

```
$ composer require spatie/laravel-littlegatekeeper
```

Start by registering the package's the service provider:

```
// config/app.php (L5)

'providers' => [
  // ...
  'Spatie\LittleGateKeeper\LittleGateKeeperServiceProvider',
],
```

Next, publish the config files:

```
$ php artisan vendor:publish --provider="Spatie\LittleGateKeeper\LittleGateKeeperServiceProvider" --tag="config"
```

Finally, register the middleware:

```
// app/Http/Kernel.php

protected $routeMiddleware = [
    // ...
    'littlegatekeeper' => \Spatie\LittleGateKeeper\AuthMiddleware::class,
];
```

Usage
-----

[](#usage)

First set up the username and password in your configuration file or .env file

In your .env file add:

```
// ...
GATEKEEPER_USERNAME=Choose_your_username
GATEKEEPER_PASSWORD=Choose_your_secret_password
```

You can protect your routes by applying the middleware:

```
Route::get('/', ['middleware' => 'littlegatekeeper', function () {
    return view('protectedpage');
}]);
```

If a user isn't logged in, he will be redirected to the url set in the config file (`littlegatekeeper.authRoute`).

### Authenticator methods

[](#authenticator-methods)

```
/**
 * @param  array $credentials  Format: ['username' => '...', 'password' => '...']
 * @return bool
 */
public function attempt($credentials)
```

```
/**
 * @return bool
 */
public function isAuthenticated()
```

```
protected function logout()
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you've found a bug regarding security please mail  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Sebastian De Deyne](https://github.com/sebastiandedeyne)
- [All Contributors](../../contributors)

About Spatie
------------

[](#about-spatie)

Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

License
-------

[](#license)

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

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance87

Actively maintained with recent releases

Popularity47

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~325 days

Recently: every ~263 days

Total

13

Last Release

86d ago

Major Versions

1.1.4 → 2.0.02021-11-30

PHP version history (3 changes)1.0.0PHP &gt;=5.3.0

2.0.0PHP ^7.4|^8.0

2.0.5PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (42 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (18 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (14 commits)")[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (14 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (10 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (8 commits)")[![alexmanase](https://avatars.githubusercontent.com/u/10696975?v=4)](https://github.com/alexmanase "alexmanase (4 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (2 commits)")[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (2 commits)")[![it-can](https://avatars.githubusercontent.com/u/644288?v=4)](https://github.com/it-can "it-can (1 commits)")[![nckrtl](https://avatars.githubusercontent.com/u/18613261?v=4)](https://github.com/nckrtl "nckrtl (1 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (1 commits)")[![Omranic](https://avatars.githubusercontent.com/u/406705?v=4)](https://github.com/Omranic "Omranic (1 commits)")[![felixdorn](https://avatars.githubusercontent.com/u/55788595?v=4)](https://github.com/felixdorn "felixdorn (1 commits)")[![pushpak1300](https://avatars.githubusercontent.com/u/31663512?v=4)](https://github.com/pushpak1300 "pushpak1300 (1 commits)")[![django23](https://avatars.githubusercontent.com/u/827397?v=4)](https://github.com/django23 "django23 (1 commits)")[![stoll](https://avatars.githubusercontent.com/u/4408878?v=4)](https://github.com/stoll "stoll (1 commits)")[![Tjoosten](https://avatars.githubusercontent.com/u/5157609?v=4)](https://github.com/Tjoosten "Tjoosten (1 commits)")[![jonassiewertsen](https://avatars.githubusercontent.com/u/38906163?v=4)](https://github.com/jonassiewertsen "jonassiewertsen (1 commits)")

---

Tags

laravelphpsecurityspatielaravel-littlegatekeeper

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-csp

Add CSP headers to the responses of a Laravel app

8569.6M19](/packages/spatie-laravel-csp)[mews/captcha

Laravel 5/6/7/8/9/10/11/12 Captcha Package

2.6k5.5M84](/packages/mews-captcha)[spatie/crypto

Encrypting and signing data using private/public keys

486763.5k10](/packages/spatie-crypto)[spatie/laravel-ciphersweet

Use ciphersweet in your Laravel project

416718.4k1](/packages/spatie-laravel-ciphersweet)[spatie/laravel-web-tinker

Artisan Tinker in your browser

1.2k3.8M6](/packages/spatie-laravel-web-tinker)[spatie/laravel-flash

A lightweight package to flash messages

6631.8M16](/packages/spatie-laravel-flash)

PHPackages © 2026

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