connorhowell/laravel-git-version 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

connorhowell/laravel-git-version

最新稳定版本:v1.0.1

Composer 安装命令:

composer require connorhowell/laravel-git-version

包简介

Retrieve current verison information about the app in the form of a git commit hash

README 文档

README

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

A Laravel package that provides easy access to Git version information for your application. This package allows you to retrieve the current Git commit hash, repository URL, and a direct link to the current commit, which can be useful for deployment tracking, debugging, and displaying version information in your application.

Installation

You can install the package via composer:

composer require connorhowell/laravel-git-version

The package will automatically register its service provider.

Usage

You can use this package in two ways: via the Facade or by directly using the class.

Using the Facade

use ConnorHowell\LaravelGitVersion\Facades\LaravelGitVersion;

// Get all version information
$versionInfo = LaravelGitVersion::getVersionInfo();
// Returns: ['version' => 'abc123...', 'repo' => 'https://github.com/user/repo', 'commit_url' => 'https://github.com/user/repo/commit/abc123...']

// Get just the current commit hash
$commitHash = LaravelGitVersion::getCurrentGitCommitHash();

// Get the repository URL
$repoUrl = LaravelGitVersion::getGitUrl();

// Get the URL to the current commit
$commitUrl = LaravelGitVersion::getCurrentCommitUrl();

Direct Usage

use ConnorHowell\LaravelGitVersion\LaravelGitVersion;

// Get all version information
$versionInfo = LaravelGitVersion::getVersionInfo();

// Get the URL to the current commit
$commitUrl = LaravelGitVersion::getCurrentCommitUrl();

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

统计信息

  • 总下载量: 152
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-01