https://github.com/beastbytes/token-uuid4
Create UUID Version 4 tokens
https://github.com/beastbytes/token-uuid4
Last synced: 3 months ago
JSON representation
Create UUID Version 4 tokens
- Host: GitHub
- URL: https://github.com/beastbytes/token-uuid4
- Owner: beastbytes
- License: bsd-3-clause
- Created: 2025-03-22T10:37:19.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-24T13:54:21.000Z (about 1 year ago)
- Last Synced: 2025-10-05T18:40:26.677Z (6 months ago)
- Language: PHP
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# BeastBytes Token Factory UUID4
Factory for generating UUID4 tokens for use in the Token Manager of
the [BeastBytes Token](https://github.com/beastbytes/token.git) package.
## Requirements
* PHP 8.1 or higher.
## Installation
Installed the package with Composer:
```php
composer require beastbytes/token-uuid4
```
or add the following to the 'require' section composer.json:
```json
"beastbytes/token-uuid4": "^1.0"
```
## Usage
If using directly:
```php
$tokenManager = new BeastBytes\Token\TokenManager(
new BeastBytes\Token\Uuid4\TokenFactory(),
new BeastBytes\Token\Php\TokenStorage() // or any other TokenStorageInterface implementation
);
```
or define in the "di" section of Yii3 configuration:
```php
return [
TokenFactoryInterface::class => \BeastBytes\Token\Uuid4\TokenFactory::class,
TokenStorageInterface::class => [
'class' => TokenStorage::class,
'__construct()' => [
// constructor arguments for the TokenStorage class
],
],
ManagerInterface::class => [
'class' => Manager::class,
'__construct()' => [
'factory' => Reference::to(TokenFactoryInterface::class),
'storage' => Reference::to(TokenStorageInterface::class),
],
],
];
```