hyvor/laravel-hyvor-connecter
最新稳定版本:1.1.7
Composer 安装命令:
composer require hyvor/laravel-hyvor-connecter
包简介
Connecting Hyvor applications to Hyvor auth
README 文档
README
Installation
composer require hyvor/laravel-hyvor-connecter
Config
Add these to the .env
HYVOR_URL- URL of Hyvor. This is internal IP in production. In testing, you may use the local URL.HYVOR_API_KEY- API Key.HYVOR_DUMMY- Set this totruein development so that dummy data will be return. Therefore, you don't need to have the auth set up and running to test the other application. Login check will always be true when using this.
Hyvor User Object
The properties of the HyvorUser object, which is returned in endpoints.
public int $id; public string $username; public string $name; public string $email; public ?string $picture_url; public ?string $location; public ?string $bio; public ?string $website_url;
Checking Login
use Hyvor\HyvorConnecter\Login; $user = Login::check(); // null | HyvorUser
Getting User Data
use Hyvor\HyvorConnecter\Userbase; // get one from ID (email is not set in the HyvorUser object) Userbase::fromId($id); // get one from ID with email Userbase::fromId($id, true); // get multiple from ID Userbase::fromIds([$id1, $id2, ...], bool $email); Userbase::fromUsername(); Userbase::fromUsernames(); Userbase::fromEmail(); Userbase::fromEmails();
Redirecting to Auth
Return URL will be added automatically so that the user will come back to the page specified after logging in or signing up.
use Hyvor\HyvorConnecter\Redirect; Redirect::to('account'); Redirect::toLogin(); Redirect::toSignup();
统计信息
- 总下载量: 297
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-01-28