PHPackages                             kanuuu/laravel-git-version - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kanuuu/laravel-git-version

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kanuuu/laravel-git-version
==========================

A helper to get the current git version of the application

1.2(8y ago)02.5kMITPHP

Since Jun 19Pushed 8y agoCompare

[ Source](https://github.com/Kanuuu/laravel-git-version)[ Packagist](https://packagist.org/packages/kanuuu/laravel-git-version)[ RSS](/packages/kanuuu-laravel-git-version/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (6)Used By (0)

Laravel/Lumen project git version getter
========================================

[](#laravellumen-project-git-version-getter)

A helper class to get the current git version of the project.

Expects either a `version` file to exist in the `base_path()` of your project containing a version string, or the `git` binary to be available.

Framework version
-----------------

[](#framework-version)

This package works with both Laravel 4 and 5, and also Lumen.

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

[](#installation)

Require it in your Laravel/Lumen project:

```
composer require kanuuu/laravel-git-version

```

Use
---

[](#use)

You can get the git version string with

```
\Kanuuu\LaravelGitVersion\GitVersionHelper::getVersion()

```

Or you can get your app name and version number such as `my-project/1.0` with

```
\Kanuuu\LaravelGitVersion\GitVersionHelper::getNameAndVersion()

```

The app's name is taken from `Config::get('app.name', 'app')`, so you can configure it in your `config/app.php` file or leave it as the default of `app`.

### Recommended usage pattern

[](#recommended-usage-pattern)

Ensure your git tags are pushed to your servers so that the versions are described properly.

During development and possibly in staging environments allow the version to be determined automatically (this is done via `git describe`).

As part of your production deployment procedure, write a `version` file (perhaps via a command like `git describe --always --tags --dirty >version`, since this is the command this package would run otherwise). When this `version` file exists the package will use its contents rather than executing `git`, saving some processor and IO time.

Add `/version` to your `.gitignore` file so your working tree stays clean and you don't accidentally commit it.

View
----

[](#view)

A view is provided which just outputs an HTML comment with the return value of `getNameAndVersion()`. I like to include this in the main layout template of the project.

To use this, install the service provider by adding it to your `config/app.php`file:

```
'providers' => [
    ...
    Kanuuu\LaravelGitVersion\GitVersionServiceProvider::class,
],

```

Then the view is available:

```
@include('git-version::version-comment')

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 58.3% 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 ~263 days

Total

5

Last Release

2930d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/43e1144f16e350d569e6e837297839d4e8602d86fb2dba34c147fe8278490870?d=identicon)[Kanuuu](/maintainers/Kanuuu)

---

Top Contributors

[![tremby](https://avatars.githubusercontent.com/u/199635?v=4)](https://github.com/tremby "tremby (7 commits)")[![Ravisdo](https://avatars.githubusercontent.com/u/16488305?v=4)](https://github.com/Ravisdo "Ravisdo (2 commits)")[![sparky-dog](https://avatars.githubusercontent.com/u/4977682?v=4)](https://github.com/sparky-dog "sparky-dog (2 commits)")[![fligno-sparky](https://avatars.githubusercontent.com/u/30251993?v=4)](https://github.com/fligno-sparky "fligno-sparky (1 commits)")

### Embed Badge

![Health badge](/badges/kanuuu-laravel-git-version/health.svg)

```
[![Health](https://phpackages.com/badges/kanuuu-laravel-git-version/health.svg)](https://phpackages.com/packages/kanuuu-laravel-git-version)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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