PHPackages                             damianchojnacki/access-token - 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. damianchojnacki/access-token

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

damianchojnacki/access-token
============================

Site access token for Laravel apps.

1.0.5(4y ago)169MITPHPPHP &gt;=7.4

Since Dec 23Pushed 4y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (6)Used By (0)

Site access token for Laravel apps
==================================

[](#site-access-token-for-laravel-apps)

[![Latest Stable Version](https://camo.githubusercontent.com/744d0c2a9c00352c84d810d36f92bacf1e137be42fbe536d4bfa46c1fe9fd863/687474703a2f2f706f7365722e707567782e6f72672f64616d69616e63686f6a6e61636b692f6163636573732d746f6b656e2f76)](https://packagist.org/packages/damianchojnacki/access-token) [![Total Downloads](https://camo.githubusercontent.com/43504e297961a512a9412bc8de08df996dc9ccb73595d5e421afba178229cbce/687474703a2f2f706f7365722e707567782e6f72672f64616d69616e63686f6a6e61636b692f6163636573732d746f6b656e2f646f776e6c6f616473)](https://packagist.org/packages/damianchojnacki/access-token) [![License](https://camo.githubusercontent.com/4a53a7076dba4602d76d9b9adb74fd2614633ae0e94da6114790da4cf014ecd3/687474703a2f2f706f7365722e707567782e6f72672f64616d69616e63686f6a6e61636b692f6163636573732d746f6b656e2f6c6963656e7365)](https://packagist.org/packages/damianchojnacki/access-token) [![PHP Version Require](https://camo.githubusercontent.com/f6f98cffac9f5f8a0a17b75adbf471816b042cb3517995dc6b7077aa3ee1a51c/687474703a2f2f706f7365722e707567782e6f72672f64616d69616e63686f6a6e61636b692f6163636573732d746f6b656e2f726571756972652f706870)](https://packagist.org/packages/damianchojnacki/access-token)

This package protects site from viewing by regular users. Only the ones who know unique token can access site.

**WARNING! This package DOES NOT ensure high level of protection! It is intended to prevent viewing site by regular users. For real authentication use proper package like Laravel Passport.**

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

[](#requirements)

It requires PHP 7.4+ and Laravel 5.8+.

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

[](#installation)

1. Install package using composer:

```
composer require damianchojnacki/access-token
```

2. Create .env configuration variables:

```
ACCESS_TOKEN=
ACCESS_EXPIRATION=
```

You can specify here your access token and expiration time in minutes (default 1 day).

Usage
-----

[](#usage)

To make usage easier there is helper middleware that validates token. If it was not found 403 error is thrown.

You can guard whole site by placing middleware into Kernel.php file

```
protected $middleware = [
    \Damianchojnacki\AccessToken\CheckAccessToken::class,
];
```

If you want to guard specific route you can define named middleware:

```
protected $routeMiddleware = [
    'access-token' => \Damianchojnacki\AccessToken\CheckAccessToken::class,
];
```

There is also command for generating new token:

```
php artisan access-token:generate
```

```
[OK] Access token saved to .env file. You can now access your site by visiting url below:

https://example.com?token=3md3Q8sLYNMCVrMvqaw67FSnUvC7d9gN
```

License
-------

[](#license)

The MIT License (MIT). Please see License File for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

Total

5

Last Release

1565d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29688019?v=4)[Damian Chojnacki](/maintainers/damianchojnacki)[@damianchojnacki](https://github.com/damianchojnacki)

---

Top Contributors

[![damianchojnacki](https://avatars.githubusercontent.com/u/29688019?v=4)](https://github.com/damianchojnacki "damianchojnacki (10 commits)")

### Embed Badge

![Health badge](/badges/damianchojnacki-access-token/health.svg)

```
[![Health](https://phpackages.com/badges/damianchojnacki-access-token/health.svg)](https://phpackages.com/packages/damianchojnacki-access-token)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

59437.0k9](/packages/jeremy379-laravel-openid-connect)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3416.9k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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