Laravel Passport oauth2.0 验证不同表用户修改

如果不用Laravel自带的User表来做权限用户表,即不用默认的guard,需要修改vender\laravel\passport\src\RouteRegister.php中的对应路由函数,['middleware' => ['web', 'auth']],将auth改为auth:newGuard.


$this->router->group(['middleware' => ['web', 'auth:admin']], function ($router) {
    $router->get('/authorize', [
        'uses' => 'AuthorizationController@authorize',
    ]);

你可能感兴趣的:(PHP)