PHPackages                             jeffersongoncalves/laravel-github-stats - 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. jeffersongoncalves/laravel-github-stats

ActiveLibrary

jeffersongoncalves/laravel-github-stats
=======================================

Self-hosted Laravel package that serves dynamic SVG cards with your GitHub statistics. Replace unreliable third-party services with your own.

v1.3.0(3w ago)313↓100%MITPHPPHP ^8.2CI passing

Since Feb 28Pushed 2w agoCompare

[ Source](https://github.com/jeffersongoncalves/laravel-github-stats)[ Packagist](https://packagist.org/packages/jeffersongoncalves/laravel-github-stats)[ GitHub Sponsors](https://github.com/jeffersongoncalves)[ RSS](/packages/jeffersongoncalves-laravel-github-stats/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (7)Versions (8)Used By (0)

[![Laravel GitHub Stats](https://raw.githubusercontent.com/jeffersongoncalves/laravel-github-stats/main/art/jeffersongoncalves-laravel-github-stats.png)](https://raw.githubusercontent.com/jeffersongoncalves/laravel-github-stats/main/art/jeffersongoncalves-laravel-github-stats.png)

Laravel GitHub Stats
====================

[](#laravel-github-stats)

[![Tests](https://github.com/jeffersongoncalves/laravel-github-stats/actions/workflows/tests.yml/badge.svg)](https://github.com/jeffersongoncalves/laravel-github-stats/actions/workflows/tests.yml)[![PHPStan](https://github.com/jeffersongoncalves/laravel-github-stats/actions/workflows/phpstan.yml/badge.svg)](https://github.com/jeffersongoncalves/laravel-github-stats/actions/workflows/phpstan.yml)[![Pint](https://github.com/jeffersongoncalves/laravel-github-stats/actions/workflows/pint.yml/badge.svg)](https://github.com/jeffersongoncalves/laravel-github-stats/actions/workflows/pint.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/151a7025091a8223a973f5e4fff00230545b509ae2e4a32b2267aef6de1e0448/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6566666572736f6e676f6e63616c7665732f6c61726176656c2d6769746875622d73746174732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeffersongoncalves/laravel-github-stats)[![Total Downloads](https://camo.githubusercontent.com/ec1858ef8b5a6dc6e3becbd7b81fa0f572f82df69c301bfd7d5c76a3698895ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6566666572736f6e676f6e63616c7665732f6c61726176656c2d6769746875622d73746174732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeffersongoncalves/laravel-github-stats)[![License](https://camo.githubusercontent.com/b95aed16deadd885275b4666cb7f8679a7a8d1eb6277714f1014382bf9895439/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a6566666572736f6e676f6e63616c7665732f6c61726176656c2d6769746875622d73746174732e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Self-hosted Laravel package that serves dynamic SVG cards with your GitHub statistics. Replace unreliable third-party services (github-readme-stats, streak-stats, github-profile-trophy) with your own private service.

Features
--------

[](#features)

- **Stats Card** — Total Stars, Commits, PRs, Issues, Followers
- **Top Languages Card** — Horizontal bar chart with top 8 languages
- **Streak Card** — Current Streak, Longest Streak, Total Contributions
- **Trophies Card** — Achievement badges with rank levels (S/A/B/C/D)
- **6 Built-in Themes** — tokyonight, dark, radical, merko, gruvbox, onedark
- **Custom Colors** — Override any color via query parameters
- **Aggressive Caching** — Two-layer cache (4h data + 1h SVG)
- **Username Locked** — Service locked to a single username via `.env`
- **Background Refresh** — Scheduled command to keep cache warm

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

[](#installation)

```
composer require jeffersongoncalves/laravel-github-stats
```

Publish the config file:

```
php artisan vendor:publish --tag="github-stats-config"
```

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

[](#configuration)

Add to your `.env`:

```
GITHUB_USERNAME=jeffersongoncalves
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
```

Create a [Personal Access Token](https://github.com/settings/tokens/new) with `read:user` scope. Add `repo` scope if you want private repository stats.

### Config Options

[](#config-options)

```
// config/github-stats.php
return [
    'username' => env('GITHUB_USERNAME', 'jeffersongoncalves'),
    'token'    => env('GITHUB_TOKEN'),

    'cache' => [
        'data_ttl' => 14400, // 4 hours
        'svg_ttl'  => 3600,  // 1 hour
    ],

    'defaults' => [
        'theme'       => 'tokyonight',
        'hide_border' => false,
        'show_icons'  => true,
        'langs_count' => 8,
    ],

    'route_prefix' => 'api',
    'middleware'    => [],
];
```

Endpoints
---------

[](#endpoints)

MethodRouteDescriptionResponseGET`/api/stats`GitHub stats cardSVGGET`/api/top-langs`Top languages cardSVGGET`/api/streak`Contribution streak cardSVGGET`/api/trophies`Achievement trophies cardSVGGET`/api/health`Service health checkJSON### Query Parameters

[](#query-parameters)

ParamDefaultOptions`theme``tokyonight``dark`, `radical`, `merko`, `gruvbox`, `onedark`, `tokyonight``hide_border``false``true`, `false``bg_color`per themeAny hex (without `#`)`title_color`per themeAny hex`text_color`per themeAny hex`icon_color`per themeAny hexUsage in GitHub README
----------------------

[](#usage-in-github-readme)

```

```

Cache Refresh
-------------

[](#cache-refresh)

The package includes a scheduled command to keep the cache warm:

```
php artisan github:refresh
```

Add to your scheduler (in `routes/console.php` or `app/Console/Kernel.php`):

```
Schedule::command('github:refresh')->everyFourHours();
```

Deployment
----------

[](#deployment)

### Option A — VPS with Forge/Ploi

[](#option-a--vps-with-forgeploi)

1. Provision a small VPS (1 vCPU, 1GB RAM)
2. Deploy your Laravel app with this package
3. Set `.env` variables
4. Setup Redis for caching
5. Configure scheduler: `* * * * * php artisan schedule:run`
6. Point subdomain: `stats.yourdomain.com`
7. SSL via Let's Encrypt

### Option B — Docker

[](#option-b--docker)

```
services:
  app:
    build: .
    ports: ["8080:80"]
    environment:
      GITHUB_USERNAME: jeffersongoncalves
      GITHUB_TOKEN: ${GITHUB_TOKEN}
    depends_on: [redis]
  redis:
    image: redis:alpine
```

Testing
-------

[](#testing)

```
composer test
```

Static Analysis
---------------

[](#static-analysis)

```
composer analyse
```

Code Formatting
---------------

[](#code-formatting)

```
composer format
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance96

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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 ~0 days

Total

7

Last Release

22d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/411493?v=4)[Jefferson Gonçalves](/maintainers/jeffersongoncalves)[@jeffersongoncalves](https://github.com/jeffersongoncalves)

---

Top Contributors

[![jeffersongoncalves](https://avatars.githubusercontent.com/u/411493?v=4)](https://github.com/jeffersongoncalves "jeffersongoncalves (19 commits)")

---

Tags

composergithub-profilegithub-readme-statsgithub-statsgithub-trophieslaravellaravel-packagephpstreak-statssvglaravelsvggithubprofilestatsstreaktrophiesgithub-statsgithub-readme-stats

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jeffersongoncalves-laravel-github-stats/health.svg)

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

###  Alternatives

[naoray/laravel-github-monolog

Log driver to store logs as github issues

10617.5k](/packages/naoray-laravel-github-monolog)[still-code/laravel-umami

Umami API wrapper for laravel

362.2k](/packages/still-code-laravel-umami)

PHPackages © 2026

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