akira / laravel-github
Advanced GitHub API integration for Laravel 12 with typed DTOs and Collections.
Fund package maintenance!
kidiatoliny
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/akira/laravel-github
Requires
- php: ^8.4.0
- firebase/php-jwt: ^6.11
- knplabs/github-api: ^3.16
Requires (Dev)
- laravel/pint: ^1.24.0
- orchestra/testbench: ^10.6
- peckphp/peck: ^0.1.3
- pestphp/pest: ^4.1.0
- pestphp/pest-plugin-type-coverage: ^4.0.2
- phpstan/phpstan: ^2.1.26
- rector/rector: ^2.1.7
- symfony/var-dumper: ^7.3.3
This package is auto-updated.
Last update: 2025-10-25 23:49:06 UTC
README
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.
Installation
composer require akira/laravel-github
php artisan vendor:publish --tag=config --provider="Akira\\GitHub\\GitHubServiceProvider"
Configuration
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, ];
Usage Examples
Users
$user = GitHub::user('octocat'); $repos = GitHub::userRepos('octocat');
Repositories
$repo = GitHub::repo('akira', 'hunter');
Issues
$issues = GitHub::issues('akira', 'hunter'); $new = GitHub::createIssue('akira', 'hunter', 'Bug', 'Description'); GitHub::commentOnIssue('akira', 'hunter', $new->number, 'Working on it!');
Pull Requests
$prs = GitHub::pulls('akira', 'hunter');
Releases
$releases = GitHub::releases('akira', 'hunter');
Organizations and Teams
$org = GitHub::organization('akira-io'); $repos = GitHub::orgRepos('akira-io'); $teams = GitHub::teams('akira-io');
Gists
$gists = GitHub::gists('octocat'); $gist = GitHub::gist('123');
GitHub Actions
$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
$checks = GitHub::checksForRef('akira', 'hunter', 'main');
Packages
$packages = GitHub::orgPackages('akira-io', 'container');
Dependabot Alerts
$alerts = GitHub::dependabotAlerts('akira', 'hunter');
Projects V2 (GraphQL)
$projects = GitHub::projectsV2('akira');
Webhook Verification
$isValid = GitHub::verifyWebhookSignature($secret, $payload, $signature);
Artisan Commands
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=5
📚 Documentation
This 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
Project Structure
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
Contributing
- 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
License
MIT