devuniverse/api-user-provider-1
Composer 安装命令:
composer require devuniverse/api-user-provider-1
包简介
Laravel UserProvider over rest api
README 文档
README
Install
Add repository to composer.json file.
"repositories": [
{
"type": "vcs",
"url": "https://github.com/cesg/api-user-provider"
}
]
Add composer dependecie
composer require cesg/api-user-provider
Configuration
publish the config file
php artisan vendor:publish --provider="Cesg\Auth\Provider\ApiUserServiceProvider" --tag="config"
return [ 'uri' => env('', 'localhost/api/v1/users'), 'bearer_token' => env('USER_PROVIDER_API_TOKEN', ''), 'headers' => [] ];
Set the driver in auth config file.
return [ 'providers' => [ 'users' => [ 'driver' => 'api-users', 'model' => Cesg\Auth\Provider\User::class, ] ], ]
If you use laravel/passport need extend the Cesg\Auth\Provider\User and add the trait Laravel\Passport\HasApiTokens and set the provider model to you own class.
class User extends \Cesg\Auth\Provider\User { use HasApiTokens; }
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-24