Retrieving a list of sponsorships should be a core feature of this library. With this, people can display the sponsorships on their app/website as well as do additional syncing in their app. The sponsorships on a GitHub account can be retrieved with the sponsorshipsAsMaintainer field. Ideally, you we'd hydrate a new GitHubSponsor object with the data from the GitHub account.
The api could like like this:
// Retrieve all sponsors of driesvints...
$sponsors = $client->sponsors('driesvints');
// With the Sponsorable trait...
$sponsors = $user->sponsors();
// Check if a user has sponsors...
$sponsors = $user->hasSponsors();
Which would return a lazy collection. I'd also opt to implement a cursor based paginator approach as well:
// Retrieve all sponsors of driesvints...
$sponsors = $client->paginateSponsors('driesvints');
Which would return an instance of Illuminate\Pagination\CursorPaginator. I'd also make use of BuildsWithQueries to resolve the cursor from the request for a Laravel implementation. See PaginationState.
Retrieving a list of sponsorships should be a core feature of this library. With this, people can display the sponsorships on their app/website as well as do additional syncing in their app. The sponsorships on a GitHub account can be retrieved with the
sponsorshipsAsMaintainer
field. Ideally, you we'd hydrate a newGitHubSponsor
object with the data from the GitHub account.The api could like like this:
Which would return a lazy collection. I'd also opt to implement a cursor based paginator approach as well:
Which would return an instance of
Illuminate\Pagination\CursorPaginator
. I'd also make use ofBuildsWithQueries
to resolve the cursor from the request for a Laravel implementation. SeePaginationState
.