PHPackages                             gdn-dev/laragit-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. gdn-dev/laragit-version

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

gdn-dev/laragit-version
=======================

Simple Laravel package to manage versions using VERSION files or Git tags

1.0.3(10mo ago)096[4 PRs](https://github.com/gdn-dev/laragit-version/pulls)MITPHPPHP ^8.1CI passing

Since Aug 27Pushed 2mo agoCompare

[ Source](https://github.com/gdn-dev/laragit-version)[ Packagist](https://packagist.org/packages/gdn-dev/laragit-version)[ Docs](https://github.com/gdn-dev/laragit-version)[ GitHub Sponsors](https://github.com/gdn-dev)[ Fund](https://opencollective.com/genial)[ RSS](/packages/gdn-dev-laragit-version/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (4)Versions (12)Used By (0)

LaraGit Version (Simplified)
============================

[](#laragit-version-simplified)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fb4dcebc76d32034d5f17931ab7bcb2a00c961f555877179f5b4a1f2918cd247/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67646e2d6465762f6c6172616769742d76657273696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gdn-dev/laragit-version)[![Tests](https://camo.githubusercontent.com/6eb6df4f90ae8bb4ffad5b6ffc1ac0041a31133e87f4b010546a66af4c95d59d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f67646e2d6465762f6c6172616769742d76657273696f6e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/gdn-dev/laragit-version/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/b0b334c70b1d1553f11079a6ba4d1e18c34af678c7b1b81635cd21ba27185357/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67646e2d6465762f6c6172616769742d76657273696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gdn-dev/laragit-version)

A simple Laravel package to manage versions in your project using either VERSION files or Git tags. No complex configuration required.

✨ Features
----------

[](#-features)

- 🚀 **Zero Configuration** - Works out of the box
- 📄 **VERSION File Support** - Read version from VERSION files
- 🎯 **Git Integration** - Uses your existing Git tags as fallback
- 🤐 **Silent Git Errors** - No error logs when Git is not available
- 🔧 **Blade Directive** - Easy template integration
- 📱 **Laravel 9-12** - Supports Laravel 9, 10, 11, and 12

📋 Requirements
--------------

[](#-requirements)

- PHP 8.1 or higher
- Laravel 9.0 - 12.x

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require gdn-dev/laragit-version
```

The package will automatically register itself via Laravel's auto-discovery.

🚀 Quick Start
-------------

[](#-quick-start)

### Basic Usage

[](#basic-usage)

```
use GenialDigitalNusantara\LaragitVersion\Facade as LaragitVersion;

// Get version with default formatting
echo LaragitVersion::show(); // "Version 1.0.0"

// Get compact version
echo LaragitVersion::show('compact'); // "v1.0.0"

// Get version info as array
$info = LaragitVersion::getVersionInfo();
```

### Using VERSION File

[](#using-version-file)

```
// Create VERSION file in project root
file_put_contents(base_path('VERSION'), '2.1.0');

// Use normally
echo LaragitVersion::show(); // "Version 2.1.0"
echo LaragitVersion::show('compact'); // "v2.1.0"
```

### Blade Templates

[](#blade-templates)

Use the convenient Blade directive:

```
{{-- Default format --}}
@laragitVersion

{{-- Compact format --}}
@laragitVersion('compact')
```

### Service Container

[](#service-container)

```
// Via service container
$version = app('gdn-dev.laragit-version')->show();

// Via dependency injection
public function __construct(LaragitVersion $laragitVersion)
{
    $this->version = $laragitVersion->show();
}
```

🎯 How It Works
--------------

[](#-how-it-works)

The package uses a simple approach:

```
'version' => file_exists(base_path('VERSION'))
    ? trim(file_get_contents(base_path('VERSION')))
    : (isGitAvailable()
        ? trim(exec('git describe --tags --abbrev=0 2>/dev/null'))
        : '0.0.0')
```

1. First checks for a VERSION file in your project root
2. If found, uses the content as the version
3. If not found, checks if Git is available
4. If Git is available, tries to get the version from Git tags
5. If Git is not available or no tags found, returns "0.0.0" as default
6. Never produces error logs when Git is not available

📄 License
---------

[](#-license)

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

👥 Credits
---------

[](#-credits)

- [Muhammad Rosyid Izzulkhaq](https://github.com/rsdiz)
- [All Contributors](../../contributors)

⭐ Show Your Support
-------------------

[](#-show-your-support)

Give a ⭐️ if this project helped you!

---

 **Made with ❤️ by [Genial Digital Nusantara](https://genilogi.id)**

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance74

Regular maintenance activity

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.8% 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 ~2 days

Total

4

Last Release

302d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22163422?v=4)[Muhammad Rosyid Izzulkhaq](/maintainers/rsdiz)[@rsdiz](https://github.com/rsdiz)

---

Top Contributors

[![rsdiz](https://avatars.githubusercontent.com/u/22163422?v=4)](https://github.com/rsdiz "rsdiz (90 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laravelSimpleversioninggitversion

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/gdn-dev-laragit-version/health.svg)

```
[![Health](https://phpackages.com/badges/gdn-dev-laragit-version/health.svg)](https://phpackages.com/packages/gdn-dev-laragit-version)
```

###  Alternatives

[pragmarx/version

Take control over your Laravel app version

5931.2M2](/packages/pragmarx-version)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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