library token
Custom token generation
infinety-es/token
Custom token generation
- Monday, May 2, 2016
- by Krato1
- Repository
- 1 Watchers
- 0 Stars
- 2 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 3 Versions
- 0 % Grown
Token
Manages random tokens for password resets and other one-time actions, (*1)
Installation
-
Install via composer: composer require infinety-es/token, (*2)
-
Add services provider to config/app.php:, (*3)
Infinety\Token\TokenServiceProvider::class,
-
Run php artisan token:migration then php artisan migrate to add the Token database table, (*4)
Usage
-
Tokens are handled via Infinety\Token\Token, which can be instantiated by the container. Example:, (*5)
$token = new Token;
$token->add($myId, 'test', 1)
-
Token parameters:, (*6)
-
Reference: integer ID of the object referred to by the token, e.g. User ID
-
Type: string determining the type of the token
-
Expires: integer determining how many minutes the token will remain valid for, null (forever) is default
-
Token::new(int $ref, string $type, int $expires = null) returns a hasID 40-character code
-
Token::find(string $code, string $type, bool $$returnRef = true) returns the reference ID or null if $returnId is = true, or Hashids decoded strings
-
Token::remove(string $code, string $type) deletes the token associated with the code (if found)
dev-master
9999999-dev
Custom token generation
Sources
Download
MIT
The Requires
The Development Requires
token
laravel 5
infinety
1.1
1.1.0.0
Custom token generation
Sources
Download
MIT
The Requires
The Development Requires
token
laravel 5
infinety
1.0
1.0.0.0
Custom token generation
Sources
Download
MIT
The Requires
The Development Requires
token
laravel 5
infinety