PHPackages                             lachezargrigorov/laravel-tokens-manager - 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. lachezargrigorov/laravel-tokens-manager

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

lachezargrigorov/laravel-tokens-manager
=======================================

An easy to use tokens manager for Laravel applications. Useful in user email confirmation process and not only.

1.0.3(3y ago)0191MITPHPPHP &gt;=5.5.9

Since Oct 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/lachezargrigorov/laravel-tokens-manager)[ Packagist](https://packagist.org/packages/lachezargrigorov/laravel-tokens-manager)[ Docs](https://github.com/lachezargrigorov/laravel-tokens-manager)[ RSS](/packages/lachezargrigorov-laravel-tokens-manager/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Tokens manager for Laravel.
===========================

[](#tokens-manager-for-laravel)

[![Latest Stable Version](https://camo.githubusercontent.com/673e4b492319fba0d949a4704d34f01f72f84b8f0095bf888dfc7511d8d6e9cb/68747470733a2f2f706f7365722e707567782e6f72672f6c616368657a6172677269676f726f762f6c61726176656c2d746f6b656e732d6d616e616765722f762f737461626c65)](https://packagist.org/packages/lachezargrigorov/laravel-tokens-manager)[![Latest Unstable Version](https://camo.githubusercontent.com/c33f8dca59770afae41aa08d213f21abce15e9eb274aa3e0731466e2132fe6d2/68747470733a2f2f706f7365722e707567782e6f72672f6c616368657a6172677269676f726f762f6c61726176656c2d746f6b656e732d6d616e616765722f762f756e737461626c65)](https://packagist.org/packages/lachezargrigorov/laravel-tokens-manager)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/7f4ba818dfadb1cc96229f7ca7a0fbbda265104395aa834e35b00370435540a7/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c616368657a6172677269676f726f762f6c61726176656c2d746f6b656e732d6d616e616765722f6d61737465722e737667)](https://travis-ci.org/lachezargrigorov/laravel-tokens-manager)[![Total Downloads](https://camo.githubusercontent.com/bab00a95f67c95398422c356fb0aa5c4aaf57e3fa6bab1450a295acefff96d8e/68747470733a2f2f706f7365722e707567782e6f72672f6c616368657a6172677269676f726f762f6c61726176656c2d746f6b656e732d6d616e616765722f646f776e6c6f616473)](https://packagist.org/packages/lachezargrigorov/laravel-tokens-manager)

An easy to use tokens manager for Laravel applications. Useful in user email confirmation process and not only.

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

[](#installation)

Via Composer

```
$ composer require lachezargrigorov\laravel-tokens-manager
```

If you do not run Laravel 5.5 (or higher), then add the service provider in config/app.php:

```
\Lachezargrigorov\TokensManager\TokensManagerServiceProvider::class,
```

If you do not run Laravel 5.5 and want to use the facade, add this to your aliases in app.php:

```
'Tokens' => \Lachezargrigorov\TokensManager\Facades\TokensManager::class,
```

Usage
-----

[](#usage)

```
//using Facades

//1. Create token with payload
$token = Tokens::use('default')->create(['userId' => 123]);

//2. Send confirmation url with created token to user per email.

//3. User click on confirmation url.

//4.Get the token's payload from the token in the url.
//This will delete the token!
$payload = Tokens::use('default')->get($token);

//if token exist and not expired
if($payload)
{
    $userId = $payload["userId"];

    //confirm user email
}

//using IOC

$tokensManager = app("tokens-manager");

$token = $tokensManager->use('default')->create(['userId' => 123]);

$payload = $tokensManager->use('default')->get($token);
```

Get payload without deleting the token

```
$payload = Tokens::use('default')->get($token,false);
```

Token not found

```
$payload = Tokens::use('default')->get($token); //null
```

**Expired tokens are deleted automatically on every Tokens::use call for all managers so you can't receive the payload of expired token and you don't need to delete them manually too!**

If you still wants to delete a token

```
$payload = Tokens::use('default')->delete($token);
```

Testing
-------

[](#testing)

```
$ composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) , [ISSUE\_TEMPLATE](ISSUE_TEMPLATE.md) and [PULL\_REQUEST\_TEMPLATE](PULL_REQUEST_TEMPLATE.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Lachezar Grigorov](http://grigorov.website)

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

1301d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laraveltokensemail validationlachezargrigorov

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/lachezargrigorov-laravel-tokens-manager/health.svg)

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

###  Alternatives

[teckwei1993/laravel-otp

Laravel OTP generator and validation

5556.0k](/packages/teckwei1993-laravel-otp)[martbock/laravel-diceware

Diceware Passphrase Generator for Laravel

3264.7k](/packages/martbock-laravel-diceware)[orchestra/auth

Auth Component for Orchestra Platform

24108.5k3](/packages/orchestra-auth)[ingria/laravel-x509-auth

Laravel 5 Client Certificate auth middleware

375.6k](/packages/ingria-laravel-x509-auth)

PHPackages © 2026

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