Source: driesvints.com

Launching PHP GitHub Sponsors

Category: Laravel, Laravel, PHP, PHP, api, api

I'm very happy to say that Tom and I finally launched PHP GitHub Sponsors, a package for PHP to interact with the GitHub Sponsors GraphQL API. Currently, PHP GitHub Sponsors allows you to do ACL based checks to see if one GitHub account is sponsoring another. While the package is framework agnostic so it can be used in any PHP application, it also comes with integration for the Laravel framework.

First, set up a personal access token in your.env file: This access token should have the user:read and organization:read scopes. Then, you can start using the package: You can also retrieve the client from the IoC container and perform calls on it: Additionally, you can add the GitHub\Sponsors\Concerns\Sponsorable trait to an Eloquent model like the User model to make it sponsorable: Then, the user will use the value of its github column as its username.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners