infinety-es/token

Custom token generation
11
Install
composer require infinety-es/token
Latest Version:1.1
PHP:>=5.5.9
Laravel:5
License:MIT
Last Updated:May 2, 2016
Links: GitHub  ·  Packagist
Maintainer: Krato1

Token

Manages random tokens for password resets and other one-time actions

Installation

  • Install via composer: composer require infinety-es/token

  • Add services provider to config/app.php:

    • Infinety\Token\TokenServiceProvider::class,
  • Run php artisan token:migration then php artisan migrate to add the Token database table

Usage

  • Tokens are handled via Infinety\Token\Token, which can be instantiated by the container. Example:
  $token = new Token;
  $token->add($myId, 'test', 1)
  • Token parameters:
    • 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)

Related Packages

infinety-es/filemanager

Laravel 5 Filemanager

2,225 32
infinety-es/gallery

Laravel 5 Photo Gallery System

172 0
fivesqrd/fluent-laravel

A Laravel 5 service provider for including the Fluent PHP library.

3,160 0
agenter-labs/illuminate-token

Token manager Laravel

3,112 1

Version History

Version Released PHP Laravel License
1.1 >=5.5.9 5.1.* || 5.2.* MIT
1.0 >=5.5.9 5.1.* || 5.2.* MIT