A Laravel package to fetch and compare GitHub repository versions.
This package provides a simple way to:
- Get the current version of a Laravel web application (from Git tags).
- Fetch the latest release tag from a GitHub repository.
- Compare the two versions to check for updates.
composer require jeromedia/laravel-github-service
php artisan vendor:publish --provider="Jeromedia\LaravelGithubService\GithubServiceProvider" --tag=config
https://api.github.com/repos/{OWNER}/{REPO}/releases/latest
#Github Connect
GITHUB_API_REPO=""
GITHUB_API_OWNER=""
GITHUB_API_VERSION="2022-11-28"
GITHUB_API_URL="https://api.github.com/repos"
GITHUB_API_TOKEN=""
GITHUB_API_CACHE_TTL=3600
https://github.com/settings/personal-access-tokens
Select only for the repository you want to get the tag version
Select ONLY "Contents", Metadata will automatically selected
<div class="container mx-auto relative"
x-data="{ github: '' }"
x-init="fetch('{{route('github.api')}}')
.then(response => response.text())
.then(data => { github = data; })">
Somewhere in your footer
<span class="text-stone-400" x-text="github"></span>
Route::get('/github', GithubController::class)->name('github.api');
php artisan vendor:publish --provider="Jeromedia\LaravelGithubService\GithubServiceProvider" --tag=routes
php artisan github-service:clear-cache
- Author: [Jerome / Jeromedia Team]
- Website: [jeromedia.com]
- Contact: [info@jeromedia.com]
- License: Private (Internal Use)
- This package requires a GitHub personal access token to fetch repository data.
- Works best with Laravel 9+ and PHP 8+.