payloadtoken/aragorn52
最新稳定版本:1.0.4
Composer 安装命令:
composer require payloadtoken/aragorn52
包简介
this library for payload from access token in lumen passport
README 文档
README
Library to add payload to Access token for lumen passport
Dependencies
- PHP >= 8.1
- Lumen >= 9.0
- Lumen-passport: >= 0.1.1
Installation via Composer
$ composer require payloadtoken/aragorn52
Or if you prefer, edit composer.json manually:
{
"require": {
"payloadtoken/aragorn52": "^1.0"
}
}
Modify the bootstrap flow (bootstrap/app.php file)
$app->register(\Payload\Providers\PassportServiceProvider::class);
Create YourCustomClaimService. Extends \Payload\Services\AbstractClaimService
in method addCustomClaim add for claimCollection your claims
id user can be obtained by accessing the $this->id property YourCustomClaimService
class YourCustomClaimService extends \Payload\Services\AbstractClaimService { public function addCustomClaims(): void { $this->claimCollection->add('test', 'testClaim'); $this->claimCollection->add('test2', 'testClaim2'); } }
Modify the AppServiceProvider flow (app/Providers/PassportServiceProvider) add this code in method boot()
public function boot() { $this->app->bind(\Payload\Services\AbstractClaimService::class, fn () => new YourCustomClaimService()); }
统计信息
- 总下载量: 52
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2022-09-17