PHPackages                             jordanpartridge/github-client - 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. [API Development](/categories/api)
4. /
5. jordanpartridge/github-client

ActiveLibrary[API Development](/categories/api)

jordanpartridge/github-client
=============================

A powerful, Laravel-first GitHub API client with auto-pagination, strong typing, and comprehensive GitHub integration for repositories, pull requests, issues, and more.

v3.0.0(9mo ago)4754[12 issues](https://github.com/jordanpartridge/github-client/issues)[6 PRs](https://github.com/jordanpartridge/github-client/pulls)2MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Nov 2Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/jordanpartridge/github-client)[ Packagist](https://packagist.org/packages/jordanpartridge/github-client)[ Docs](https://github.com/jordanpartridge/github-client)[ GitHub Sponsors](https://github.com/JordanPartridge)[ RSS](/packages/jordanpartridge-github-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (15)Versions (42)Used By (2)

GitHub Client for Laravel
=========================

[](#github-client-for-laravel)

**Stop wrestling with GitHub's API. Start shipping.**

```
composer require jordanpartridge/github-client
```

```
// That's it. You're done.
$repos = Github::repos()->all();
$issues = Github::issues()->forRepo('owner', 'repo');
$pr = Github::pullRequests()->create('owner', 'repo', 'My PR', 'feature', 'main');
```

[![Tests](https://camo.githubusercontent.com/6df7765e774a4de99ef1db18952c11d6c32ee94036ff1bafa1aed24335e32916/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f7264616e7061727472696467652f6769746875622d636c69656e742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/jordanpartridge/github-client/actions)[![Latest Version](https://camo.githubusercontent.com/7889bb278a3860dbf2070fc0bfdf5fcf9d7b0b0d7762a33d29ebcddfb690bf1e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f7264616e7061727472696467652f6769746875622d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jordanpartridge/github-client)[![Downloads](https://camo.githubusercontent.com/dc3631f451653f610fd14b1aea2127ed4bee25bce7ced2ab846e911e434da1b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f7264616e7061727472696467652f6769746875622d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jordanpartridge/github-client)

---

Why This Package?
-----------------

[](#why-this-package)

- **Laravel Native** - Built for Laravel, not wrapped around it
- **Typed Responses** - DTOs everywhere, not arrays
- **Auto-Pagination** - `allWithPagination()` just works
- **Type-Safe Params** - Enums, not magic strings
- **Easy Testing** - Saloon MockClient built in

**One line: Modern GitHub API for modern Laravel.**

---

Quick Start
-----------

[](#quick-start)

### 1. Install

[](#1-install)

```
composer require jordanpartridge/github-client
```

### 2. Configure

[](#2-configure)

Add your token to `.env`:

```
GITHUB_TOKEN=ghp_your_token_here
```

Get one at [github.com/settings/tokens](https://github.com/settings/tokens)

### 3. Use

[](#3-use)

```
use JordanPartridge\GithubClient\Facades\Github;

// Get your repos
$repos = Github::repos()->all();

// Get ALL your repos (auto-pagination, no limits)
$allRepos = Github::repos()->allWithPagination();

// Get a specific repo
$repo = Github::repos()->get('jordanpartridge/github-client');

echo $repo->name;              // "github-client"
echo $repo->stargazers_count;  // 🤞
echo $repo->owner->login;      // "jordanpartridge"
```

---

Real Examples
-------------

[](#real-examples)

### Create an Issue

[](#create-an-issue)

```
$issue = Github::issues()->create(
    owner: 'jordanpartridge',
    repo: 'github-client',
    title: 'Bug: Something broke',
    body: 'Here are the details...',
    labels: ['bug', 'high-priority'],
    assignees: ['jordanpartridge']
);

echo $issue->number;   // 42
echo $issue->html_url; // Direct link to GitHub
```

### Create a Pull Request

[](#create-a-pull-request)

```
use JordanPartridge\GithubClient\Enums\MergeMethod;

// Create PR
$pr = Github::pullRequests()->create(
    owner: 'jordanpartridge',
    repo: 'github-client',
    title: 'Add new feature',
    head: 'feature-branch',
    base: 'main',
    body: 'This PR adds the thing.',
    draft: false
);

// Merge it
Github::pullRequests()->merge(
    owner: 'jordanpartridge',
    repo: 'github-client',
    number: $pr->number,
    mergeMethod: MergeMethod::Squash
);
```

### Work with Issue Comments

[](#work-with-issue-comments)

```
// Get all comments on an issue
$comments = Github::issues()->comments('owner', 'repo', 42);

// Add a comment
Github::issues()->addComment('owner', 'repo', 42, 'Fixed in latest release.');

// Close the issue
Github::issues()->close('owner', 'repo', 42);
```

### Filter with Enums (Type-Safe)

[](#filter-with-enums-type-safe)

```
use JordanPartridge\GithubClient\Enums\Visibility;
use JordanPartridge\GithubClient\Enums\Sort;
use JordanPartridge\GithubClient\Enums\Direction;
use JordanPartridge\GithubClient\Enums\Issues\State;

// Only public repos, sorted by creation date
$repos = Github::repos()->allWithPagination(
    visibility: Visibility::PUBLIC,
    sort: Sort::CREATED,
    direction: Direction::DESC
);

// Open bugs only
$bugs = Github::issues()->forRepo(
    owner: 'jordanpartridge',
    repo: 'github-client',
    state: State::OPEN,
    labels: 'bug'
);
```

---

Testing Your App
----------------

[](#testing-your-app)

Saloon's MockClient makes testing trivial:

```
use Saloon\Http\Faking\MockClient;
use Saloon\Http\Faking\MockResponse;
use JordanPartridge\GithubClient\Facades\Github;

it('creates issues', function () {
    $mock = new MockClient([
        '*' => MockResponse::make([
            'id' => 1,
            'number' => 42,
            'title' => 'Test Issue',
            'state' => 'open',
        ], 201),
    ]);

    Github::connector()->withMockClient($mock);

    $issue = Github::issues()->create('owner', 'repo', 'Test Issue');

    expect($issue->number)->toBe(42);
    expect($issue->title)->toBe('Test Issue');
});
```

No HTTP calls. No flaky tests. No rate limits in CI.

---

Available Resources
-------------------

[](#available-resources)

ResourceMethods`repos()``all`, `allWithPagination`, `get`, `delete`, `search``issues()``all`, `forRepo`, `allForRepo`, `get`, `create`, `update`, `close`, `reopen`, `comments`, `addComment``pullRequests()``all`, `get`, `create`, `merge`, `files`, `commits``commits()``all`, `get``files()``get`, `contents``releases()``all`, `get`, `latest`, `create``actions()``workflows`, `runs`, `trigger`---

Dependency Injection
--------------------

[](#dependency-injection)

Don't like facades? Use DI:

```
use JordanPartridge\GithubClient\Contracts\GithubConnectorInterface;

class MyService
{
    public function __construct(
        private readonly GithubConnectorInterface $github
    ) {}

    public function getMyRepos()
    {
        return $this->github->repos()->all();
    }
}
```

---

OAuth Flow
----------

[](#oauth-flow)

Building a GitHub app? OAuth is built in:

```
use JordanPartridge\GithubClient\Facades\GithubOAuth;

// 1. Redirect user to GitHub
return redirect(GithubOAuth::getAuthorizationUrl(['repo', 'user']));

// 2. Handle callback
$token = GithubOAuth::getAccessToken($request->code);

// 3. Use their token
$github = new GithubConnector($token);
$theirRepos = $github->repos()->all();
```

---

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11 or 12

---

Contributing
------------

[](#contributing)

PRs welcome. Run tests first:

```
composer test
```

---

License
-------

[](#license)

MIT. Go build something.

---

**Built with [Saloon](https://github.com/Sammyjo20/Saloon)** by [Jordan Partridge](https://github.com/jordanpartridge)

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance56

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 88.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 ~16 days

Recently: every ~5 days

Total

18

Last Release

281d ago

Major Versions

v0.3.1 → v2.0.02025-06-14

v1.4.0 → v2.3.02025-06-27

v2.9.0 → v3.0.02025-08-10

PHP version history (2 changes)v0.1aPHP ^8.2

v2.0.0PHP ^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6bb27de88a541a632427686306c8fc56366d72582f6a3316d20500efe7971f3?d=identicon)[conduit-ui](/maintainers/conduit-ui)

---

Top Contributors

[![jordanpartridge](https://avatars.githubusercontent.com/u/9040417?v=4)](https://github.com/jordanpartridge "jordanpartridge (102 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

apigithublaravellaravel-packagephplaravelgithubsaloongitapi clientrepositoriesversion controlpull-requestsissuesGitHub-APIconduit-uigithub-client

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jordanpartridge-github-client/health.svg)

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

###  Alternatives

[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[codebar-ag/laravel-zammad

Zammad integration with Laravel

106.1k](/packages/codebar-ag-laravel-zammad)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)

PHPackages © 2026

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