astrotomic/laravel-github-sponsors

v1.0.0 2023-04-02 09:47 UTC

This package is auto-updated.

Last update: 2024-09-17 14:01:19 UTC


README

MIT License Latest Version PHP

Ecologi Larabelles opendor.me

GitHub Workflow Status GitHub Workflow Status Total Downloads

获取任何用户/组织的GitHub赞助情况,并检查是否有人为您提供赞助。

安装

composer require astrotomic/laravel-github-sponsors

配置

设置 services.github.sponsors_token 配置值或覆盖您自己的服务提供程序中的服务绑定。所使用的PAT至少需要read:userread:org权限来检索所有赞助。

$this->app->when(\Astrotomic\GithubSponsors\Graphql::class)
    ->needs('$token')
    ->give('my_custom_secret');

用法

use Astrotomic\GithubSponsors\Facades\GithubSponsors;

// all sponsors for current authenticated user
GithubSponsors::viewer()->sponsors();
// all sponsors for given name without knowing what it is
GithubSponsors::login('larabelles')->sponsors();
// all sponsors for given user
GithubSponsors::user('Gummibeer')->sponsors();
// all sponsors for given organization
GithubSponsors::organization('Astrotomic')->sponsors();

// select specific attributes
GithubSponsors::viewer()->sponsors(['login', 'name', 'avatarUrl']);
// select specific attributes and company only for users
GithubSponsors::viewer()->sponsors(['login', 'name', 'avatarUrl'], ['company']);
// select specific attributes and email only for organizations
GithubSponsors::viewer()->sponsors(['login', 'name', 'avatarUrl'], [], ['email']);

// check if viewer sponsored by Gummibeer
GithubSponsors::viewer()->isSponsoredBy('Gummibeer');
// check if viewer sponsors Gummibeer
GithubSponsors::viewer()->isSponsoring('Gummibeer');
// check if viewer has sponsors
GithubSponsors::viewer()->hasSponsors();
// check how many sponsors the viewer has
GithubSponsors::viewer()->sponsorsCount();

变更日志

请参阅变更日志以获取有关最近更改的更多信息。

贡献

请参阅贡献指南以获取详细信息。您可能还对行为准则感兴趣。

安全性

如果您发现任何与安全性相关的问题,请检查安全性以获取报告步骤。

致谢

许可证

MIT许可证(MIT)。请参阅许可证文件以获取更多信息。

无价之宝

您可以免费使用此包,但如果它进入您的生产环境,我将非常感激您为世界买一棵树。

现在众所周知,应对气候危机并防止气温上升超过1.5C的最好工具之一是种植树木。如果您为我的森林做出贡献,您将为当地家庭创造就业机会并恢复野生动物栖息地。

您可以在ecologi.com/astrotomic购买树木

有关无价之宝的更多信息,请参阅treeware.earth