PHPackages                             ssionn/github-forge-laravel - 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. ssionn/github-forge-laravel

ActiveLibrary[API Development](/categories/api)

ssionn/github-forge-laravel
===========================

A GitHub REST API client for Laravel

v1.0.7(10mo ago)0130MITPHPPHP ^8.4CI failing

Since Jul 23Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/Ssionn/github-forge)[ Packagist](https://packagist.org/packages/ssionn/github-forge-laravel)[ RSS](/packages/ssionn-github-forge-laravel/feed)WikiDiscussions production Synced yesterday

READMEChangelog (10)Dependencies (9)Versions (17)Used By (0)

GitHub Forge Laravel
====================

[](#github-forge-laravel)

A Laravel package for interacting with the GitHub REST API. Facades are the preferred usage pattern.

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

[](#installation)

1. Require the package:

- `composer require ssionn/github-forge-laravel`

2. If you don’t use package auto-discovery, register the provider (only if needed):

- `Ssionn\GithubForgeLaravel\GithubForgeServiceProvider::class,`

3. Publish config (optional, for customizing defaults):

- `php artisan vendor:publish \ --provider="Ssionn\GithubForgeLaravel\GithubForgeServiceProvider" \ --tag=config`

4. In your .env (or .env.testing) set your token:

- `GITHUB_FORGE_TOKEN=your_github_token_here`

The package’s `config/github-forge.php` reads this by default.

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

[](#configuration)

config/github-forge.php

```
return [
    'token' => env('GITHUB_FORGE_TOKEN', ''),
];

```

Publish and override as needed.

Facade (preferred usage)
------------------------

[](#facade-preferred-usage)

- Bindings keep a default app-wide token (singleton) for non-auth flows or defaults.
- Use the facade with per-request tokens when needed via `withToken()`.

Alias in config/app.php (if you’re not using auto-discovery):

- `'GithubForge' => Ssionn\GithubForgeLaravel\Facades\GithubForge::class,`

Usage examples (facade-first)

- Per-request token (recommended when a user has a unique token):

```
    use Ssionn\GithubForgeLaravel\Facades\GithubForge;

    // Resolve the per-request token (user token or default)
    $token = auth()->user()?->github_token ?? config('github-forge.token');

    // Per-request client, then call
    $repos = GithubForge::withToken($token)->getRepositories('octocat', ['per_page' => 50]);

```

- Simple usage with the default app token:
- `$user = GithubForge::getUser('octocat');`
- Other methods (examples)
- `$repo = GithubForge::getRepository('laravel', 'framework');`
- `$contributors = GithubForge::getContributors('laravel', 'framework');`
- `$commits = GithubForge::getCommitsFromRepository('laravel', 'framework', [ 'sha' => 'main', 'per_page' => 20, ]);`
- `$issues = GithubForge::getIssues('laravel', 'framework', [ 'state'    => 'closed', 'per_page' => 30, ]);`
- `$pulls = GithubForge::getPullRequests('laravel', 'framework', [ 'state'    => 'all', 'per_page' => 10, ]);`

Token storage and migrations (new)
----------------------------------

[](#token-storage-and-migrations-new)

If you store GitHub tokens in the database, use encrypted storage and a separate hash for uniqueness.

What to add in migrations

- Add a column github\_secret\_token and a unique github\_token\_hash.
- Encrypt the github\_secret\_token via Eloquent’s encrypted cast.
- Compute and store github\_token\_hash from the plaintext token.

Example migration (to adapt to your user/model table; adjust table name as needed, e.g., users, github\_accounts, etc.):

```
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddGithubTokenColumnsToUsersTable extends Migration
{
    public function up(): void
    {
        Schema::table('users', function (Blueprint $table) {
            // Store the secret token encrypted at rest
            $table->text('github_secret_token')->nullable();
            // Hash for uniqueness (e.g., to prevent duplicates)
            $table->string('github_token_hash')->nullable()->unique();
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn(['github_secret_token', 'github_token_hash']);
        });
    }
}

```

Model changes (to apply encryption and hash)

- Assuming you store tokens on the User model (adjust to your real model).

```
class User extends Authenticatable
{
    // Encrypt the github_secret_token in storage
    protected $casts = [
        'github_secret_token' => 'encrypted',
    ];

    // Optional: hide sensitive fields from arrays/json
    protected $hidden = [
      'github_secret_token',
      'github_token_hash',
    ];

    // Ensure a hash is stored whenever the secret token is set
    public function setGithubSecretTokenAttribute(?string $value)
    {
        // Hash for uniqueness
        $this->attributes['github_token_hash'] = $value ? hash('sha256', $value) : null;
        // Store the encrypted token (the cast handles encryption)
        $this->attributes['github_secret_token'] = $value;
    }
}

```

Notes:

- The github\_secret\_token is encrypted at rest using Laravel’s encryption. Accessing auth()-&gt;user()-&gt;github\_secret\_token will yield the plaintext token due to the encrypted cast.
- github\_token\_hash is unique to prevent storing multiple identical tokens for the same user (or globally, depending on your schema).
- If you need to search by token value, you’ll query by github\_token\_hash, not github\_secret\_token.
- Ensure APP\_KEY is set in your environment for encryption to work.
- If you already have tokens in place, you may need a one-time migration to populate github\_token\_hash for existing records.

Usage reminder

- For per-request tokens, prefer GithubForge::withToken($token) (facade-first).
- For defaults, rely on the singleton binding that reads GITHUB\_FORGE\_TOKEN from config (don't use `withToken(string $token)`.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance54

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~28 days

Recently: every ~3 days

Total

15

Last Release

310d ago

Major Versions

v0.0.61 → v1.0.02025-08-08

PHP version history (2 changes)v0.0.55PHP ^8.1

v1.0.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/90753599?v=4)[Casper Kizewski](/maintainers/Ssionn)[@Ssionn](https://github.com/Ssionn)

---

Top Contributors

[![Ssionn](https://avatars.githubusercontent.com/u/90753599?v=4)](https://github.com/Ssionn "Ssionn (50 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ssionn-github-forge-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/ssionn-github-forge-laravel/health.svg)](https://phpackages.com/packages/ssionn-github-forge-laravel)
```

###  Alternatives

[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[nuwave/lighthouse

A framework for serving GraphQL from Laravel

3.5k11.8M117](/packages/nuwave-lighthouse)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)

PHPackages © 2026

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