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).
Searching users, getting user information and managing authenticated user account information. Wrap GitHub User API.
Use the Search API to find users by keyword.
$users = $client->api('user')->all(135);
Returns an array of all users that registered after the user whose ID is 135.
$users = $client->api('user')->all();
Returns an array of all users.
$user = $client->api('user')->show('KnpLabs');
Returns an array of information about the user.
You can also use the User ID, but it will use an undocumented GitHub API
$user = $client->api('user')->showById(202732);
Requires authentication.
Change user attributes: name, email, blog, company, location.
$client->api('current_user')->update(array(
'location' => 'France',
'blog' => 'http://diem-project.org/blog'
));
Returns an array of information about the user.
$users = $client->api('user')->following('KnpLabs');
Returns an array of followed users.
For authenticated user use.
Requires authentication.
$users = $client->api('current_user')->follow()->all();
$users = $client->api('user')->followers('KnpLabs');
Returns an array of following users.
For authenticated user use.
Requires authentication.
$users = $client->api('current_user')->followers();
Requires authentication.
Make the authenticated user follow a user.
$client->api('current_user')->follow()->follow('symfony');
Returns an array of followed users.
Requires authentication.
Make the authenticated user unfollow a user.
$client->api('current_user')->follow()->unfollow('symfony');
Returns an array of followed users.
See more.
$users = $client->api('user')->watched('ornicar');
For authenticated user use.
Requires authentication.
$users = $client->api('current_user')->watchers()->all();
Returns an array of watched repos.
See more.
$users = $client->api('user')->starred('ornicar');
For authenticated user use.
Requires authentication.
$users = $client->api('current_user')->starring()->all();
Returns an array of starred repos.
Requires authentication.
$activity = $client->api('user')->events('ornicar');
Returns an array of private and public events created for all repos related to the user.
See more.
Requires authentication.
$emails = $client->api('current_user')->emails()->all();
Returns an array of the authenticated user emails.
Requires authentication.
$emails = $client->api('current_user')->emails()->add('my-email@provider.org');
// or add few emails at once
$emails = $client->api('current_user')->emails()->add(array('first@provider.org', 'second@provider.org'));
Returns an array of the authenticated user emails.
Requires authentication.
$emails = $client->api('current_user')->emails()->remove('my-email@provider.org');
// or remove few emails at once
$emails = $client->api('current_user')->emails()->remove(array('first@provider.org', 'second@provider.org'));
Return an array of the authenticated user emails.
How can I help you explore Laravel packages today?