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)164MITPHPPHP &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 today

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

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

1510d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e8271e942223e98e780238fd2fcdc60f9da6cbf6b2cef7b92976b01f61f059ee?d=identicon)[damianchojnacki](/maintainers/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

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[overtrue/laravel-follow

User follow unfollow system for Laravel.

1.2k404.7k5](/packages/overtrue-laravel-follow)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)

PHPackages © 2026

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