programic / laravel-hoorayhr
HoorayHR API的包装器
v1.0.0
2021-08-13 09:11 UTC
Requires
- ext-json: *
- guzzlehttp/guzzle: ~6.0 | ~7.0
README
此包是HoorayHR API的包装器
安装
此包需要PHP 7.2和Laravel 5.8或更高版本。
composer require programic/permissions
设置
将Hooray凭据添加到config/services.php
return [ 'hooray' => [ 'username' => env('HOORAY_USERNAME', '') 'password' => env('HOORAY_PASSWORD', '') ], ];
并更新.env凭据。
基本用法
use Programic\Hooray\HoorayHR; public function index(HoorayHR $hooray) { // Fetch users $hooray->getUsers(); // Fetch & filter calendars $hooray->getCalenders(['year' => 2021, 'userId' => 1]); }
扩展凭据
您可以按认证用户更新HoorayHR凭据。这可以通过在Service Provider中添加以下内容来实现
use Programic\Hooray\HoorayHR; $this->app->resolving(HoorayHR::class, function ($hooray) { $hooray->setCredentials('username', 'password'); });
测试
composer test
贡献
有关详细信息,请参阅CONTRIBUTING
安全
如果您发现任何与安全相关的问题,请通过电子邮件info@programic.com联系,而不是使用问题跟踪器。
鸣谢
许可
MIT许可(MIT)。有关更多信息,请参阅许可文件