Download the PHP package zionon/multiauth without Composer

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

MultiAuth For Laravel 5.1


安装

代码基于Kbwebs/MultiAuth完善!!!

Authentication

Open up the config/app.php file and replace the AuthServiceProvider with:

And open config/auth.php file and remove:(如果搭配entrust使用的话,建议保留)

and replace it with this array:

If you want to use Database instead of Eloquent you can use it as:

Password Resets

如果后台的不需要通过邮件重置密码的话(后台不建议开启邮件重置密码),使用laravel自带的即可,使用的是config/auth配置中'multi-auth'数组的第一个认证driver。只需要把默认的app/Http/Controllers/Auth/PasswordController

后台不需要邮件重置的密码的话,下面的可不需要做

Open up config/app.php file and replace the PasswordResetServiceProvider with:

If you want to use the password resets from this Package you will need to change this in each Model there use password resets:

to

If you want to change the view for password reset for each auth type you can add this to the multi-auth array in config/auth.php:

If you dont add this line, Laravel will automatically use the default path for emails.password like its defined in the password array.

To generate the password resets table you will need to run the following command:

Likewise, if you want to clear all password resets, you have to run the following command:

NOTE It is very important that you replace the default service providers. If you do not wish to use Password resets, then remove the original Password resets server provider as it will cause errors.

Usage

Authentication:

直接使用trait即可

然后在控制器指定使用的model

protected $authModel = 'user'

其他属性和laravel自带的属性一样可以设置,新增的有

$loginView 登录显示文件

$registerView 注册显示文件

$remember 是否使用记住我功能

重点说一下多重登录,比如可以同时使用用户名,邮件,手机号码登录,暂时也只做了这三个,大部分情况应该也够用了。

属性$username为多重登录的关键,如果属性不设置或为字符串则是单认证登录,默认为email,可以改用户名或者手机号码.

如果$username为数组的话,则把登录认证的数组填进去,默认使用的name为authfield。如果自定义的话,则必须把authfield加入到数组中,否则会报错。

To do list

完善密码重置已经密码重置页面自定义

完善readme

写一个demo

完善多重登录

Password resets:

密码也改写了,用了trait

It works just like the original laravel authentication library, the only change is the user() or admin() it will match the auth type, as your defining in the multi-auth array:

But now it has to be like, with the user() or admin():

Example for a password reset email:

This generates a URL like the following:

Which will match the following route:

Tip:

Remember to update all places where ex: Auth:: is been using, to ex: Auth::user() or what you have defined in config/auth.php


All versions of multiauth with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/auth Version ~5.1
illuminate/console Version ~5.1
illuminate/database Version ~5.1
illuminate/filesystem Version ~5.1
illuminate/support Version ~5.1
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 zionon/multiauth contains the following files

Loading the files please wait ....