Download the PHP package lahaxearnaud/laravel-token without Composer

On this page you can find all versions of the php package lahaxearnaud/laravel-token. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-token

Laravel token

Build Status SensioLabsInsight CodeClimat Test Coverage License Scrutinizer Code Quality

Table of Contents

Installation

Database

Provider

Facade

Usage

Create token

If $allowLogin is set to true the token can be use to authentification via route filter.

Crypt token

If $allowLogin is set to true the token can be use to authentification via route filter.

Validate token

If you crypt your token

If you don't crypt your token:

If you use those functions the token is not burn. It can be use many times.

For one shot usage token:

Route filter

Simple token protection:

Authentification by token:

The token used for an authentification must be a login token, pleaserefer to the token creation section

In order to use the authentification by token your class User need to implements Lahaxearnaud\LaravelToken\Models\UserTokenInterface

The method loggableByToken is called when a user try to authentificate with a token.

If an error occur on token validation a TokenExeption is throw, please go to Exceptions section.

By default you can send your token in parameter or header. The default name of the field is token but you can change it by publishing and change the configuration:

Then change the tokenFieldName config/packages/lahaxearnaud/laravel-token/config.php.

You can get the token instance via:

Exceptions

If you use route filter you need to handle some Exceptions. Add the following error handler in you filter.php to catch them. This is basic example, change the behavior to fit your needs (redirect, log...).

Events

You can listen events:

Commands

A new artisan command is added to your project in order to help you to clean your token table

### Delete expired tokens
    Without any option the command delete all expired tokens.

### Truncate the table
    If you specified ``--all`` all token will be deleted

API

Security

Crypt a string token in order to get a public token

Uncrypt a public token in order to get the private token

Creation

Create a Token instance (directly saved in database)

If $allowLogin is set to true the token can be use to authentification via route filter.

Deletion

Delete the token

Validation

Fetch the token, check id the token has the good user ID and if it is not expired

Same as isValidToken but uncrypt the token before trying to find him

Only validate if the token is expired

Find

Find the token by ID

Find the token by token string

Find all token for an user

Todo


All versions of laravel-token with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 4.2.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lahaxearnaud/laravel-token contains the following files

Loading the files please wait ....