<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jeffersongoncalves / laravel-github-contributions example snippets
// config/github-contributions.php
return [
// Falls back to config('services.github.token') when empty.
'token' => env('GITHUB_TOKEN'),
'user_agent' => env('GITHUB_CONTRIBUTIONS_USER_AGENT', 'laravel-github-contributions'),
'timeout' => (int) env('GITHUB_CONTRIBUTIONS_TIMEOUT', 8),
// Cache responses (keyed by login) to stay under the 5000/hr API limit.
// Set ttl to 0 to disable caching entirely.
'cache' => [
'ttl' => (int) env('GITHUB_CONTRIBUTIONS_CACHE_TTL', 3600),
],
];
use JeffersonGoncalves\GitHubContributions\GitHubContributions;
$data = GitHubContributions::fetch('jeffersongoncalves');
// [
// 'cells' => [0, 1, 0, 2, 4, 3, 0, ...], // list<int 0-4>, 7 per week, column-major
// 'total' => 1234, // total contributions in the calendar window
// ]