PHPackages                             attla/data-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. attla/data-token

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

attla/data-token
================

Turn everything into a token: randomized or predictable.

v2.x-dev(3y ago)122MITPHPPHP &gt;=7.2.5

Since Aug 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/attla/data-token)[ Packagist](https://packagist.org/packages/attla/data-token)[ RSS](/packages/attla-data-token/feed)WikiDiscussions main Synced 1mo ago

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

Data Token
==========

[](#data-token)

[![License](https://camo.githubusercontent.com/891419a00e04aa0e311068fa8a04eec92cab4f7026c76278279bf2a1da50e578/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d6c69676874677265792e737667)](LICENSE)[![Latest Stable Version](https://camo.githubusercontent.com/a2b12095b004d252f9839463a6c0d752126008c1097281e535fc8bc114d4402b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6174746c612f646174612d746f6b656e)](https://packagist.org/packages/attla/data-token)[![Total Downloads](https://camo.githubusercontent.com/d77ad6b2366e384167eef18c2ed877eaf60e73036c485f722e68441fcaee5daa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6174746c612f646174612d746f6b656e)](https://packagist.org/packages/attla/data-token)

🪅 Turn everything into a token: randomized or predictable.

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

[](#installation)

```
composer require attla/data-token
```

Usage
-----

[](#usage)

Creating and managing a token

```
use Attla\DataToken\Facade as DataToken;

// Create with facade
$token = DataToken::secrete('your secret phrase');

// Set the issuer claim
$token->iss();

// Set the expiration in minutes
$token->exp(120);

// Set payload of the token
$token->payload($model);

// Set the browser identifier on token
$token->bwr();

// Set user IP on the token
$token->ip();

// Get the token
$tokenEncoded = $token->encode();
```

Decoding the token

```
// Get token value as associative array
$tokenValue = DataToken::decode($tokenEncoded, true);

// Aliases for decode a token
$tokenValue = DataToken::fromString($tokenEncoded);
$tokenValue = DataToken::parseString($tokenEncoded);
$tokenValue = DataToken::parse($tokenEncoded);
```

Others ways to make a token

```
// Make a unique token from anything
$id = DataToken::id(123);

// Make always the same token
$sid = DataToken::sid(123);

// Make a strong token
$sign = DataToken::sign(123);
```

### List of message methods

[](#list-of-message-methods)

MethodParametersDescription`encode()`-Encode the token`decode(data, assoc)`String, BooleanDecode the token, will be return false if as invalid`fromString(data, assoc)`String, BooleanAlias for `decode()``parseString(data, assoc)`String, BooleanAlias for `decode()``parse(data, assoc)`String, BooleanAlias for `decode()``iss()`-Define the token issuer claim`exp(minutes)`Integer or CarbonInterfaceTime to expire the token`payload(content)`MixedSet the content of the token, that can be a model, array, object, or anything, but can't be false`bwr()`-Set the browser identifier to the token`ip()`-Set the IP address from user to the token`body()`-Alias for `payload()``same()`-Make the token always the same`sign(minutesExpiration)`Integer or CarbonInterfaceCreate a strong validation of the token`id(data)`MixedGenerate a unique identifier of anything`sid(data)`-Always generate the same identifier of anything`getEntropy()`-Get entropy of the tokenLicense
-------

[](#license)

This package is licensed under the [MIT license](LICENSE) © [Octha](https://octha.com).

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

1123d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/682727?v=4)[Andre Goncalves](/maintainers/nicolau)[@nicolau](https://github.com/nicolau)

---

Top Contributors

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

---

Tags

data-tokendata-transformationjwtjwt-tokenlaravellaravel-packagetokentokenizationtokenizerlaraveltokenizerattladata-to-token

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/attla-data-token/health.svg)

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

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[corbosman/laravel-passport-claims

Add claims to Laravel Passport JWT Tokens

88655.9k](/packages/corbosman-laravel-passport-claims)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)

PHPackages © 2026

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