{"id":36980217,"url":"https://github.com/jordanpartridge/github-client","last_synced_at":"2026-01-13T22:49:52.981Z","repository":{"id":260364756,"uuid":"881087706","full_name":"jordanpartridge/github-client","owner":"jordanpartridge","description":"A Github client that plays nice with Laravel","archived":false,"fork":false,"pushed_at":"2026-01-02T00:29:00.000Z","size":464,"stargazers_count":4,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-07T08:43:58.682Z","etag":null,"topics":["api","github","laravel","laravel-package"],"latest_commit_sha":null,"homepage":"https://jordanpartridge.us","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jordanpartridge.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"JordanPartridge"}},"created_at":"2024-10-30T22:20:31.000Z","updated_at":"2026-01-02T00:29:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"8cf5f4c5-dc75-4794-bf07-0124d98c640f","html_url":"https://github.com/jordanpartridge/github-client","commit_stats":null,"previous_names":["jordanpartridge/github-client"],"tags_count":19,"template":false,"template_full_name":"PartridgeRocks/package-skeleton-laravel","purl":"pkg:github/jordanpartridge/github-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanpartridge%2Fgithub-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanpartridge%2Fgithub-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanpartridge%2Fgithub-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanpartridge%2Fgithub-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jordanpartridge","download_url":"https://codeload.github.com/jordanpartridge/github-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordanpartridge%2Fgithub-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28403750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","github","laravel","laravel-package"],"created_at":"2026-01-13T22:49:52.902Z","updated_at":"2026-01-13T22:49:52.960Z","avatar_url":"https://github.com/jordanpartridge.png","language":"PHP","readme":"# GitHub Client for Laravel\n\n**Stop wrestling with GitHub's API. Start shipping.**\n\n```bash\ncomposer require jordanpartridge/github-client\n```\n\n```php\n// That's it. You're done.\n$repos = Github::repos()-\u003eall();\n$issues = Github::issues()-\u003eforRepo('owner', 'repo');\n$pr = Github::pullRequests()-\u003ecreate('owner', 'repo', 'My PR', 'feature', 'main');\n```\n\n[![Tests](https://img.shields.io/github/actions/workflow/status/jordanpartridge/github-client/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/jordanpartridge/github-client/actions)\n[![Latest Version](https://img.shields.io/packagist/v/jordanpartridge/github-client.svg?style=flat-square)](https://packagist.org/packages/jordanpartridge/github-client)\n[![Downloads](https://img.shields.io/packagist/dt/jordanpartridge/github-client.svg?style=flat-square)](https://packagist.org/packages/jordanpartridge/github-client)\n\n---\n\n## Why This Package?\n\n- **Laravel Native** - Built for Laravel, not wrapped around it\n- **Typed Responses** - DTOs everywhere, not arrays\n- **Auto-Pagination** - `allWithPagination()` just works\n- **Type-Safe Params** - Enums, not magic strings\n- **Easy Testing** - Saloon MockClient built in\n\n**One line: Modern GitHub API for modern Laravel.**\n\n---\n\n## Quick Start\n\n### 1. Install\n\n```bash\ncomposer require jordanpartridge/github-client\n```\n\n### 2. Configure\n\nAdd your token to `.env`:\n\n```env\nGITHUB_TOKEN=ghp_your_token_here\n```\n\nGet one at [github.com/settings/tokens](https://github.com/settings/tokens)\n\n### 3. Use\n\n```php\nuse JordanPartridge\\GithubClient\\Facades\\Github;\n\n// Get your repos\n$repos = Github::repos()-\u003eall();\n\n// Get ALL your repos (auto-pagination, no limits)\n$allRepos = Github::repos()-\u003eallWithPagination();\n\n// Get a specific repo\n$repo = Github::repos()-\u003eget('jordanpartridge/github-client');\n\necho $repo-\u003ename;              // \"github-client\"\necho $repo-\u003estargazers_count;  // 🤞\necho $repo-\u003eowner-\u003elogin;      // \"jordanpartridge\"\n```\n\n---\n\n## Real Examples\n\n### Create an Issue\n\n```php\n$issue = Github::issues()-\u003ecreate(\n    owner: 'jordanpartridge',\n    repo: 'github-client',\n    title: 'Bug: Something broke',\n    body: 'Here are the details...',\n    labels: ['bug', 'high-priority'],\n    assignees: ['jordanpartridge']\n);\n\necho $issue-\u003enumber;   // 42\necho $issue-\u003ehtml_url; // Direct link to GitHub\n```\n\n### Create a Pull Request\n\n```php\nuse JordanPartridge\\GithubClient\\Enums\\MergeMethod;\n\n// Create PR\n$pr = Github::pullRequests()-\u003ecreate(\n    owner: 'jordanpartridge',\n    repo: 'github-client',\n    title: 'Add new feature',\n    head: 'feature-branch',\n    base: 'main',\n    body: 'This PR adds the thing.',\n    draft: false\n);\n\n// Merge it\nGithub::pullRequests()-\u003emerge(\n    owner: 'jordanpartridge',\n    repo: 'github-client',\n    number: $pr-\u003enumber,\n    mergeMethod: MergeMethod::Squash\n);\n```\n\n### Work with Issue Comments\n\n```php\n// Get all comments on an issue\n$comments = Github::issues()-\u003ecomments('owner', 'repo', 42);\n\n// Add a comment\nGithub::issues()-\u003eaddComment('owner', 'repo', 42, 'Fixed in latest release.');\n\n// Close the issue\nGithub::issues()-\u003eclose('owner', 'repo', 42);\n```\n\n### Filter with Enums (Type-Safe)\n\n```php\nuse JordanPartridge\\GithubClient\\Enums\\Visibility;\nuse JordanPartridge\\GithubClient\\Enums\\Sort;\nuse JordanPartridge\\GithubClient\\Enums\\Direction;\nuse JordanPartridge\\GithubClient\\Enums\\Issues\\State;\n\n// Only public repos, sorted by creation date\n$repos = Github::repos()-\u003eallWithPagination(\n    visibility: Visibility::PUBLIC,\n    sort: Sort::CREATED,\n    direction: Direction::DESC\n);\n\n// Open bugs only\n$bugs = Github::issues()-\u003eforRepo(\n    owner: 'jordanpartridge',\n    repo: 'github-client',\n    state: State::OPEN,\n    labels: 'bug'\n);\n```\n\n---\n\n## Testing Your App\n\nSaloon's MockClient makes testing trivial:\n\n```php\nuse Saloon\\Http\\Faking\\MockClient;\nuse Saloon\\Http\\Faking\\MockResponse;\nuse JordanPartridge\\GithubClient\\Facades\\Github;\n\nit('creates issues', function () {\n    $mock = new MockClient([\n        '*' =\u003e MockResponse::make([\n            'id' =\u003e 1,\n            'number' =\u003e 42,\n            'title' =\u003e 'Test Issue',\n            'state' =\u003e 'open',\n        ], 201),\n    ]);\n\n    Github::connector()-\u003ewithMockClient($mock);\n\n    $issue = Github::issues()-\u003ecreate('owner', 'repo', 'Test Issue');\n\n    expect($issue-\u003enumber)-\u003etoBe(42);\n    expect($issue-\u003etitle)-\u003etoBe('Test Issue');\n});\n```\n\nNo HTTP calls. No flaky tests. No rate limits in CI.\n\n---\n\n## Available Resources\n\n| Resource | Methods |\n|----------|---------|\n| `repos()` | `all`, `allWithPagination`, `get`, `delete`, `search` |\n| `issues()` | `all`, `forRepo`, `allForRepo`, `get`, `create`, `update`, `close`, `reopen`, `comments`, `addComment` |\n| `pullRequests()` | `all`, `get`, `create`, `merge`, `files`, `commits` |\n| `commits()` | `all`, `get` |\n| `files()` | `get`, `contents` |\n| `releases()` | `all`, `get`, `latest`, `create` |\n| `actions()` | `workflows`, `runs`, `trigger` |\n\n---\n\n## Dependency Injection\n\nDon't like facades? Use DI:\n\n```php\nuse JordanPartridge\\GithubClient\\Contracts\\GithubConnectorInterface;\n\nclass MyService\n{\n    public function __construct(\n        private readonly GithubConnectorInterface $github\n    ) {}\n\n    public function getMyRepos()\n    {\n        return $this-\u003egithub-\u003erepos()-\u003eall();\n    }\n}\n```\n\n---\n\n## OAuth Flow\n\nBuilding a GitHub app? OAuth is built in:\n\n```php\nuse JordanPartridge\\GithubClient\\Facades\\GithubOAuth;\n\n// 1. Redirect user to GitHub\nreturn redirect(GithubOAuth::getAuthorizationUrl(['repo', 'user']));\n\n// 2. Handle callback\n$token = GithubOAuth::getAccessToken($request-\u003ecode);\n\n// 3. Use their token\n$github = new GithubConnector($token);\n$theirRepos = $github-\u003erepos()-\u003eall();\n```\n\n---\n\n## Requirements\n\n- PHP 8.2+\n- Laravel 11 or 12\n\n---\n\n## Contributing\n\nPRs welcome. Run tests first:\n\n```bash\ncomposer test\n```\n\n---\n\n## License\n\nMIT. Go build something.\n\n---\n\n**Built with [Saloon](https://github.com/Sammyjo20/Saloon)** by [Jordan Partridge](https://github.com/jordanpartridge)\n","funding_links":["https://github.com/sponsors/JordanPartridge"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordanpartridge%2Fgithub-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordanpartridge%2Fgithub-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordanpartridge%2Fgithub-client/lists"}