This package will allow you to integrate github api into laravel application.
get package from composer composer require sharik709/laravel-github
If you are using laravel 5.5 and above then you don't need to register service provider. Otherwise, you will need to add this package's service provider into your config/app.php
file's providers array.
LaravelGithub\LaravelGithubServiceProvider::class
In your .env
file you will need to setup your api keys. Which you can get from github
[Laravel Github Keys]
[Laravel Github API]
GITHUB_USERNAME=
GITHUB_PASSWORD=
You can also set these things to .env.example
Now, You should be able to use the api
use LaravelGithub\Repositories;
$repos = new Repositories;
$repositories = $repos->list()
use LaravelGithub\Repositories;
$repos = new Repository;
$repository = $repos->get($name);
$repository->issues()
$repository->pullRequests();
$repository->contributors();
above $repository
variable can be the result of get
or you can call list
get list of repositories and find the one you want to work with and call above methods.
This package has been built on top of another package called tan-tan-kanarek/github-php-client
. This package is a
wrapper on that package. Credit for building such a great functionality to interact with github is to tan tan kanarek
.
MIT