PHPackages                             graham-campbell/github - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. graham-campbell/github

ActiveLibrary[Framework](/categories/framework)

graham-campbell/github
======================

GitHub Is A GitHub Bridge For Laravel

v13.0.0(1y ago)6411.7M—4.4%124[1 issues](https://github.com/GrahamCampbell/Laravel-GitHub/issues)19MITPHPPHP ^8.1CI passing

Since Jul 27Pushed 1y ago20 watchersCompare

[ Source](https://github.com/GrahamCampbell/Laravel-GitHub)[ Packagist](https://packagist.org/packages/graham-campbell/github)[ GitHub Sponsors](https://github.com/GrahamCampbell)[ Fund](https://tidelift.com/funding/github/packagist/graham-campbell/github)[ RSS](/packages/graham-campbell-github/feed)WikiDiscussions 13.0 Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (110)Used By (19)

Laravel GitHub
==============

[](#laravel-github)

Laravel GitHub was created by, and is maintained by [Graham Campbell](https://github.com/GrahamCampbell), and is a [PHP GitHub API](https://github.com/KnpLabs/php-github-api) bridge for [Laravel](https://laravel.com/). It utilises my [Laravel Manager](https://github.com/GrahamCampbell/Laravel-Manager) package. Feel free to check out the [change log](CHANGELOG.md), [releases](https://github.com/GrahamCampbell/Laravel-GitHub/releases), [security policy](https://github.com/GrahamCampbell/Laravel-GitHub/security/policy), [license](LICENSE), [code of conduct](.github/CODE_OF_CONDUCT.md), and [contribution guidelines](.github/CONTRIBUTING.md).

[![Banner](https://user-images.githubusercontent.com/2829600/71477348-60993680-27e1-11ea-845e-fbc2ee79ed7d.png)](https://user-images.githubusercontent.com/2829600/71477348-60993680-27e1-11ea-845e-fbc2ee79ed7d.png)

[![Build Status](https://camo.githubusercontent.com/ba750dbdec90a34177bed96d7157344ab8c4134ed0db914e88138fedb53cc378/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f47726168616d43616d7062656c6c2f4c61726176656c2d4769744875622f74657374732e796d6c3f6c6162656c3d5465737473267374796c653d666c61742d737175617265)](https://github.com/GrahamCampbell/Laravel-GitHub/actions?query=workflow%3ATests)[![StyleCI Status](https://camo.githubusercontent.com/c1e57681ad728089b0cfe50982f38e6bc3212bd321595cddb0e08eebaaac3b2a/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f32323238383836392f736869656c64)](https://github.styleci.io/repos/22288869)[![Software License](https://camo.githubusercontent.com/c090e080484e2a2bc766446291d04437db823929042bf614b26a1643660ddf6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e3f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist Downloads](https://camo.githubusercontent.com/20d3d0bf1999946643db1d5477e6eb3e41f901cd73cf9e9291f52e6ce0c81617/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67726168616d2d63616d7062656c6c2f6769746875623f7374796c653d666c61742d737175617265)](https://packagist.org/packages/graham-campbell/github)[![Latest Version](https://camo.githubusercontent.com/a58648fef59cd61635ca02d97180eee4c5f574cc0b102f6866559c7d52144aa8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f47726168616d43616d7062656c6c2f4c61726176656c2d4769744875623f7374796c653d666c61742d737175617265)](https://github.com/GrahamCampbell/Laravel-GitHub/releases)

Installation
------------

[](#installation)

This version requires [PHP](https://www.php.net/) 8.1-8.4 and supports [Laravel](https://laravel.com/) 10-12.

GitHubL5.5L5.6L5.7L5.8L6L7L8L9L10L11L127.8✅✅✅✅❌❌❌❌❌❌❌8.9✅✅✅✅✅✅❌❌❌❌❌9.8❌❌❌❌✅✅✅❌❌❌❌10.6❌❌❌❌✅✅✅✅❌❌❌11.0❌❌❌❌❌❌✅✅❌❌❌12.8❌❌❌❌❌❌✅✅✅✅❌13.0❌❌❌❌❌❌❌❌✅✅✅To get the latest version, simply require the project using [Composer](https://getcomposer.org/):

```
$ composer require "graham-campbell/github:^13.0"
```

Once installed, if you are not using automatic package discovery, then you need to register the `GrahamCampbell\GitHub\GitHubServiceProvider` service provider in your `config/app.php`.

You can also optionally alias our facade:

```
        'GitHub' => GrahamCampbell\GitHub\Facades\GitHub::class,
```

Configuration
-------------

[](#configuration)

Laravel GitHub requires connection configuration.

To get started, you'll need to publish all vendor assets:

```
$ php artisan vendor:publish
```

This will create a `config/github.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

There are two config options:

##### Default Connection Name

[](#default-connection-name)

This option (`'default'`) is where you may specify which of the connections below you wish to use as your default connection for all work. Of course, you may use many connections at once using the manager class. The default value for this setting is `'main'`.

##### GitHub Connections

[](#github-connections)

This option (`'connections'`) is where each of the connections are setup for your application. Example configuration has been included, but you may add as many connections as you would like. Note that the 5 supported authentication methods are: `"application"`, `"jwt"`, `"none"`, `"private"`, and `"token"`.

##### HTTP Cache

[](#http-cache)

This option (`'cache'`) is where each of the cache configurations setup for your application. Only the "illuminate" driver is provided out of the box. Example configuration has been included.

Usage
-----

[](#usage)

##### GitHubManager

[](#githubmanager)

This is the class of most interest. It is bound to the ioc container as `'github'` and can be accessed using the `Facades\GitHub` facade. This class implements the `ManagerInterface` by extending `AbstractManager`. The interface and abstract class are both part of my [Laravel Manager](https://github.com/GrahamCampbell/Laravel-Manager) package, so you may want to go and checkout the docs for how to use the manager class over at [that repo](https://github.com/GrahamCampbell/Laravel-Manager#usage). Note that the connection class returned will always be an instance of `Github\Client`.

##### Facades\\GitHub

[](#facadesgithub)

This facade will dynamically pass static method calls to the `'github'` object in the ioc container which by default is the `GitHubManager` class.

##### GitHubServiceProvider

[](#githubserviceprovider)

This class contains no public methods of interest. This class should be added to the providers array in `config/app.php`. This class will setup ioc bindings.

##### Real Examples

[](#real-examples)

Here you can see an example of just how simple this package is to use. Out of the box, the default adapter is `main`. After you enter your authentication details in the config file, it will just work:

```
use GrahamCampbell\GitHub\Facades\GitHub;
// you can alias this in config/app.php if you like

GitHub::me()->organizations();
// we're done here - how easy was that, it just works!

GitHub::repo()->show('GrahamCampbell', 'Laravel-GitHub');
// this example is simple, and there are far more methods available
```

The github manager will behave like it is a `Github\Client` class. If you want to call specific connections, you can do with the `connection` method:

```
use GrahamCampbell\GitHub\Facades\GitHub;

// the alternative connection is the other example provided in the default config
GitHub::connection('alternative')->me()->emails()->add('foo@bar.com');

// now we can see the new email address in the list of all the user's emails
GitHub::connection('alternative')->me()->emails()->all();
```

With that in mind, note that:

```
use GrahamCampbell\GitHub\Facades\GitHub;

// writing this:
GitHub::connection('main')->issues()->show('GrahamCampbell', 'Laravel-GitHub', 2);

// is identical to writing this:
GitHub::issues()->show('GrahamCampbell', 'Laravel-GitHub', 2);

// and is also identical to writing this:
GitHub::connection()->issues()->show('GrahamCampbell', 'Laravel-GitHub', 2);

// this is because the main connection is configured to be the default
GitHub::getDefaultConnection(); // this will return main

// we can change the default connection
GitHub::setDefaultConnection('alternative'); // the default is now alternative
```

If you prefer to use dependency injection over facades like me, then you can easily inject the manager like so:

```
use GrahamCampbell\GitHub\GitHubManager;

class Foo
{
    public function __construct(
        private readonly GitHubManager $github,
    ) {
    }

    public function bar()
    {
        $this->github->issues()->show('GrahamCampbell', 'Laravel-GitHub', 2);
    }
}

app(Foo::class)->bar();
```

For more information on how to use the `Github\Client` class we are calling behind the scenes here, check out the docs at , and the manager class at .

##### Further Information

[](#further-information)

There are other classes in this package that are not documented here. This is because they are not intended for public use and are used internally by this package.

Security
--------

[](#security)

If you discover a security vulnerability within this package, please send an email to . All security vulnerabilities will be promptly addressed. You may view our full security policy [here](https://github.com/GrahamCampbell/Laravel-GitHub/security/policy).

License
-------

[](#license)

Laravel GitHub is licensed under [The MIT License (MIT)](LICENSE).

For Enterprise
--------------

[](#for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of `graham-campbell/github` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-graham-campbell-github?utm_source=packagist-graham-campbell-github&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance44

Moderate activity, may be stable

Popularity64

Solid adoption and visibility

Community38

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 97.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~35 days

Recently: every ~0 days

Total

110

Last Release

441d ago

Major Versions

v9.8.1 → v10.0.12021-01-08

9.8.x-dev → v10.0.22021-01-14

v10.6.0 → v11.0.02022-05-31

11.0.x-dev → 12.0.x-dev2023-03-07

12.8.x-dev → 13.0.x-dev2025-03-03

PHP version history (9 changes)v0.1.0-alphaPHP &gt;=5.4.7

v3.1.0PHP &gt;=5.5.9

v6.0.0PHP ^7.0

v7.0.0PHP ^7.1.3

v9.0.0PHP ^7.2.4

v9.0.1PHP ^7.2.5

v10.0.0PHP ^7.2.5 || ^8.0

v11.0.0PHP ^7.4.15 || ^8.0.2

13.0.x-devPHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d95eb26cb8f3919bb5ca3b6d823daeabbf259663778a970349b245c580713c8e?d=identicon)[graham-campbell](/maintainers/graham-campbell)

---

Top Contributors

[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (465 commits)")[![darkboywonder](https://avatars.githubusercontent.com/u/6867485?v=4)](https://github.com/darkboywonder "darkboywonder (1 commits)")[![diegohq](https://avatars.githubusercontent.com/u/1486939?v=4)](https://github.com/diegohq "diegohq (1 commits)")[![driesvints](https://avatars.githubusercontent.com/u/594614?v=4)](https://github.com/driesvints "driesvints (1 commits)")[![dschniepp](https://avatars.githubusercontent.com/u/1108670?v=4)](https://github.com/dschniepp "dschniepp (1 commits)")[![ellisio](https://avatars.githubusercontent.com/u/127468?v=4)](https://github.com/ellisio "ellisio (1 commits)")[![jbrooksuk](https://avatars.githubusercontent.com/u/246103?v=4)](https://github.com/jbrooksuk "jbrooksuk (1 commits)")[![jrean](https://avatars.githubusercontent.com/u/5646128?v=4)](https://github.com/jrean "jrean (1 commits)")[![lucasmichot](https://avatars.githubusercontent.com/u/513603?v=4)](https://github.com/lucasmichot "lucasmichot (1 commits)")[![phated](https://avatars.githubusercontent.com/u/992373?v=4)](https://github.com/phated "phated (1 commits)")[![ahinkle](https://avatars.githubusercontent.com/u/17038330?v=4)](https://github.com/ahinkle "ahinkle (1 commits)")[![PoLaKoSz](https://avatars.githubusercontent.com/u/1327533?v=4)](https://github.com/PoLaKoSz "PoLaKoSz (1 commits)")

---

Tags

hacktoberfestframeworklaravelgithubGraham CampbellGrahamCampbellBridgephp-github-apigithub bridgeLaravel GitHub

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/graham-campbell-github/health.svg)

```
[![Health](https://phpackages.com/badges/graham-campbell-github/health.svg)](https://phpackages.com/packages/graham-campbell-github)
```

###  Alternatives

[graham-campbell/gitlab

GitLab Is A GitLab Bridge For Laravel

141584.1k2](/packages/graham-campbell-gitlab)[graham-campbell/bitbucket

Bitbucket Is A Bitbucket Bridge For Laravel

75185.0k2](/packages/graham-campbell-bitbucket)[graham-campbell/digitalocean

DigitalOcean Is A DigitalOcean Bridge For Laravel

509343.1k2](/packages/graham-campbell-digitalocean)[graham-campbell/markdown

Markdown Is A CommonMark Wrapper For Laravel

1.3k7.1M64](/packages/graham-campbell-markdown)[graham-campbell/manager

Manager Provides Some Manager Functionality For Laravel

39221.1M134](/packages/graham-campbell-manager)[graham-campbell/throttle

Throttle Is A Rate Limiter For Laravel

7102.3M11](/packages/graham-campbell-throttle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
