PHPackages                             erwane/cakephp-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. erwane/cakephp-token

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

erwane/cakephp-token
====================

CakePHP plugin for tokens

3.1.0(2d ago)42.6k↓37.5%2MITPHPPHP ^8.2CI failing

Since Jul 27Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Erwane/cakephp-token)[ Packagist](https://packagist.org/packages/erwane/cakephp-token)[ Fund](https://www.buymeacoffee.com/erwane)[ GitHub Sponsors](https://github.com/Erwane)[ RSS](/packages/erwane-cakephp-token/feed)WikiDiscussions 3.x Synced today

READMEChangelog (5)Dependencies (11)Versions (24)Used By (0)

Token plugin for CakePHP
========================

[](#token-plugin-for-cakephp)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)[![codecov](https://camo.githubusercontent.com/9d5c3cf5fcbcd39c9df14090e742160771d01684f408673e4412c623b4059f4f/68747470733a2f2f636f6465636f762e696f2f67682f457277616e652f63616b657068702d746f6b656e2f6272616e63682f332e782f67726170682f62616467652e7376673f746f6b656e3d41693467633147503950)](https://codecov.io/gh/Erwane/cakephp-token)[![Build Status](https://github.com/Erwane/cakephp-token/actions/workflows/ci.yml/badge.svg?branch=3.x)](https://github.com/Erwane/cakephp-token/actions)[![Packagist Downloads](https://camo.githubusercontent.com/f4ddde67183d2d804b30794134a4afff2ac2953862409953ea0c1ee2850f0b47/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f457277616e652f63616b657068702d746f6b656e)](https://packagist.org/packages/Erwane/cakephp-token)[![Packagist Version](https://camo.githubusercontent.com/a333432472194031ef595b5ba39af5ece08334ebe5eff9dcf865b0e469a64b74/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f457277616e652f63616b657068702d746f6b656e)](https://packagist.org/packages/Erwane/cakephp-token)

Version map
-----------

[](#version-map)

branchCakePHP corePHP min1.x^3.0PHP 7.22.x^4.0PHP 7.43.x^5.0PHP 8.1Description
-----------

[](#description)

This is a really "easy to use" CakePHP plugin for generating and reading temporaries tokens

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

[](#installation)

```
composer require erwane/cakephp-token
bin/cake migrations migrate -p Token
```

Usage
-----

[](#usage)

### Generate a token

[](#generate-a-token)

```
/**
 * Create a token with data and return the id
 * @param  array  $content   an array of custom data
 * @param  string $expire    expire exprimed in '+6 days +2 hours' format
 * @param  int $length Token length
 * @return string            The token id
 */

$myNewTokenId = \Token\Token::generate(array $content, $expire, 8);
```

### Get token

[](#get-token)

```
// return null (expired or not found) or Token entity
$token = \Token\Token::get($tokenId);
```

### Delete token

[](#delete-token)

Tokens deletion can be ignored, they will be destroyed on expire, but sometime you need to delete one token immediately

```
/**
 * Delete token from id or entity
 *
 * @param \Token\Model\Entity\Token|string $token Token entity or id
 * @return bool True if token was deleted
 */
$result = \Token\Token::delete($token);
```

### Auto cleaning

[](#auto-cleaning)

Each time a token is read, expired tokens are pruned

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance65

Regular maintenance activity

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.6% 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 ~148 days

Recently: every ~240 days

Total

23

Last Release

2d ago

Major Versions

v1.x-dev → 2.0.02021-01-18

v2.x-dev → 3.0.02025-01-04

PHP version history (5 changes)1.0.0PHP &gt;=5.6

1.4.0PHP &gt;=7.2

v2.x-devPHP &gt;=7.4.0,&lt;9

3.0.0PHP ^8.1

3.1.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/91732d78336582954080932d4350d08420a053dbba6728f1727b5500ab931c65?d=identicon)[Erwane](/maintainers/Erwane)

---

Top Contributors

[![Erwane](https://avatars.githubusercontent.com/u/712604?v=4)](https://github.com/Erwane "Erwane (70 commits)")[![rrd108](https://avatars.githubusercontent.com/u/3147489?v=4)](https://github.com/rrd108 "rrd108 (1 commits)")

---

Tags

cakephpcakephp-plugintokencakephp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/erwane-cakephp-token/health.svg)

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

###  Alternatives

[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

3361.0M51](/packages/dereuromark-cakephp-tools)[cakephp/bake

Bake plugin for CakePHP

11212.0M202](/packages/cakephp-bake)[dereuromark/cakephp-queue

The Queue plugin for CakePHP provides deferred task execution.

308954.9k25](/packages/dereuromark-cakephp-queue)[dereuromark/cakephp-ide-helper

CakePHP IdeHelper Plugin to improve auto-completion

1882.3M44](/packages/dereuromark-cakephp-ide-helper)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

3099.1k6](/packages/dereuromark-cakephp-dto)[dereuromark/cakephp-tinyauth

A CakePHP plugin to handle user authentication and authorization the easy way.

131240.2k13](/packages/dereuromark-cakephp-tinyauth)

PHPackages © 2026

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