Download the PHP package bnabriss/mix-auth without Composer

On this page you can find all versions of the php package bnabriss/mix-auth. 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 mix-auth

Mix Auth

This auth vendor used for laravel framework, to mix laravel sessions with api tokens, so you can use the same middleware and same routes to authenticate the request, if the request contains sessions cookie or it support an api token.

Features

Requirements

Installation

Require this package with composer.

Laravel >5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider. If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

You can customize some settings of the vendor using config/mix-auth.php that you can publish it using the publish command

so we encourage you to read config file and learn more about customization After you customize you config you should migrate your database to add tokens table to your database using migration command

Note that migration depends on some configuration in config file, so we encourage you to re-migrate (refresh) database after you make changes in the config file.

The models that use this auth should use the HasMixAuth.php trait in your model to add some helpful methods in your model

Usage

Generate token

You can generate token for the user simply generate token of custom user or for authenticated user with specific guard.

Note that to use the guard you must specify it the config file so you can use it, by default the file contains only web guard, see user example in the config file itself.

Note that the generate token methods will not generate sessions if you disable the key token_sessions in the config or it already generated.

Auth middleware

You can simply set the middleware for the route using the route-middleware, so the middleware will register the auth if the token exist. if the token has invalid value or expired the middleware will throw an exception

Delete token

You can delete user token by using the defined relations token in the trait

or you can even delete all tokens for that user (including other devices' tokens) by

You may need to disable api middleware auth:api if you need to use this vendor to api route


All versions of mix-auth with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
illuminate/auth Version ^5.6
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 bnabriss/mix-auth contains the following files

Loading the files please wait ....