knplabs/github-api
Lightweight, well-tested PHP wrapper for GitHub APIs v3 (REST) and v4 (GraphQL). PSR-17/PSR-18 compatible via HTTPlug, with easy setup using Guzzle, Symfony HttpClient, or other PSR clients. Supports framework integrations (Laravel via graham-campbell/github).
Wraps GitHub Applications API.
For the installation id 123 use the following:
$token = $client->api('apps')->createInstallationToken(123);
To create an access token on behalf of a user with id 456 use:
$token = $client->api('apps')->createInstallationToken(123, 456);
Find all installations for the authenticated application.
$installations = $client->api('apps')->findInstallations();
$installations = $client->api('current_user')->installations();
List repositories that are accessible to the authenticated installation.
$repositories = $client->api('apps')->listRepositories($userId);
$repositories = $client->api('current_user')->repositoriesByInstallation($installationId, $parameters);
$client->api('apps')->addRepository($installationId, $repositoryId);
$client->api('apps')->removeRepository($installationId, $repositoryId);
$authenticatedApp = $client->api('apps')->getAuthenticatedApp();
How can I help you explore Laravel packages today?