A Laravel 12+ package to interact with the GitHub REST and GraphQL APIs using a strongly-typed, collection-friendly interface.
This package provides:
- Fully typed DTOs for common GitHub resources (users, repos, issues, PRs, actions, packages, dependabot, etc.).
- High-level service
GitHubManagerwith caching and rate limiting. - Artisan commands to quickly query GitHub resources.
- 100% test coverage with Pest and static analysis with Larastan.
composer require akira/laravel-github
php artisan vendor:publish --tag=config --provider="Akira\\GitHub\\GitHubServiceProvider"return [
'token' => env('GITHUB_TOKEN', null),
'cache' => [
'ttl' => 300,
'prefix' => 'github:',
'ttls' => [
'issues' => 60,
'pulls' => 60,
'releases' => 300,
],
],
'pagination' => ['per_page' => 30],
'rate_limiter' => ['max' => 60, 'decay_seconds' => 60],
'events' => true,
];$user = GitHub::user('octocat');
$repos = GitHub::userRepos('octocat');$repo = GitHub::repo('akira', 'hunter');$issues = GitHub::issues('akira', 'hunter');
$new = GitHub::createIssue('akira', 'hunter', 'Bug', 'Description');
GitHub::commentOnIssue('akira', 'hunter', $new->number, 'Working on it!');$prs = GitHub::pulls('akira', 'hunter');$releases = GitHub::releases('akira', 'hunter');$org = GitHub::organization('akira-io');
$repos = GitHub::orgRepos('akira-io');
$teams = GitHub::teams('akira-io');$gists = GitHub::gists('octocat');
$gist = GitHub::gist('123');$runs = GitHub::actionsWorkflowRuns('akira', 'hunter');
GitHub::actionsRerun('akira', 'hunter', $runs[0]->id);
GitHub::actionsCancel('akira', 'hunter', $runs[0]->id);
GitHub::actionsDownloadArtifact('akira', 'hunter', $runs[0]->id, storage_path('artifact.zip'));$checks = GitHub::checksForRef('akira', 'hunter', 'main');$packages = GitHub::orgPackages('akira-io', 'container');$alerts = GitHub::dependabotAlerts('akira', 'hunter');$projects = GitHub::projectsV2('akira');$isValid = GitHub::verifyWebhookSignature($secret, $payload, $signature);php artisan github:user octocat
php artisan github:repo akira hunter
php artisan github:issue:list akira hunter
php artisan github:pr:list akira hunter
php artisan github:actions:runs akira hunter --per_page=5This package also includes a dedicated docs/ folder with extended details:
- Installation β docs/installation.md
- Configuration β docs/configuration.md
- Usage β docs/usage.md
- Commands β docs/commands.md
- Advanced Topics β docs/advanced.md
- Contributing β docs/contributing.md
- Roadmap β docs/roadmap.md
laravel-github/
βββ src/ # Package source code
βββ tests/ # Pest test suite
βββ docs/ # Extended documentation
βββ README.md # Quick start & inline docs
βββ composer.json
βββ pest.php / phpunit.xml
- Fork the repo
- Create your feature branch (
git checkout -b feature/my-feature) - Run tests (
composer test) - Ensure code style and static analysis pass (
composer analyse) - Submit a PR
MIT