2017 © Pedro Peláez
 

library laravel5-multi-auth

laravel5 mutil auth

image

hacklee/laravel5-multi-auth

laravel5 mutil auth

  • Wednesday, March 4, 2015
  • by hacklee
  • Repository
  • 1 Watchers
  • 11 Stars
  • 2,238 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

ravel5 多个Auth实现 License, (*1)

参考 https://github.com/ollieread/multiauth 写的4.2版思路

使用composer加载到项目

  • 修改composer.json 增加下面的require
 "require": {
    "hacklee/laravel5-multi-auth": "dev-master"
 }
  • 执行 composer update

使用步骤

  • 替换app.config 中的'Illuminate\Auth\AuthServiceProvider' 为 'Hacklee\Multiauth\XhAuthServiceProvider'
  • 更改auth.php

配置示例:, (*2)

<?php
return [ 
        'cp' => [ 
                'driver' => 'cp',

                'model' => 'App\CpUser',

                'table' => 'cp_user',

                'password' => [ 
                        'email' => 'emails.password',
                        'table' => 'password_resets',
                        'expire' => 60 
                ] 
        ],
        'op' => [ 
                'driver' => 'op',

                'model' => 'App\OpUser',

                'table' => 'op_user',

                'password' => [ 
                        'email' => 'emails.password',
                        'table' => 'password_resets',
                        'expire' => 60 
                ] 
        ],
        'api' => [ 
                'driver' => 'api',

                'model' => 'App\ApiUser',

                'table' => 'api_user',

                'password' => [ 
                        'email' => 'emails.password',
                        'table' => 'password_resets',
                        'expire' => 60 
                ] 
        ] 
];

使用示例

Auth::cp()->attempt();
Auth::api()->attempt();
Auth::op()->attempt();

The Versions

04/03 2015

dev-master

9999999-dev

laravel5 mutil auth

  Sources   Download

MIT

The Requires

  • php >=5.4.0