2017 © Pedro Peláez
 

library auth-token

image

liamqma/auth-token

  • Thursday, December 19, 2013
  • by liamqma
  • Repository
  • 2 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Laravel 4 Multipe User Type Auth token

It's a fork of https://github.com/tappleby/laravel-auth-token, (*1)

Getting Started

Setup

Add the package to your composer.json, (*2)

"require": {
    ...
    "liamqma/auth-token": "dev-master"
}

Add the service provider to app/config/app.php, (*3)

'Liamqma\AuthToken\AuthTokenServiceProvider',

Setup the optional aliases in app/config/app.php, (*4)

'AuthToken' => 'Liamqma\Support\Facades\AuthToken',

Currently the auth tokens are stored in the database, you will need to run the migrations:, (*5)

php artisan migrate --package=liamqma/auth-token

Usage

Generate Token, (*6)

$user_id = 1;
$user_type = 'Accessor';
AuthToken::createToken($user_id,$user_type)

Validate Token, (*7)

$result = AuthToken::validateToken($token);
if($result===TURE)
    ...

Get User Id after validation, (*8)

$user_id = AuthToken::getUserId()

The Versions

19/12 2013

dev-master

9999999-dev

  Sources   Download

The Requires

 

The Development Requires

by Avatar liamqma