PHPackages                             tobya/laravel-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. tobya/laravel-version

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

tobya/laravel-version
=====================

Semantic app versioning for Laravel with git integration.

v103.2(1mo ago)053MITPHPPHP ^8.1|^8.2|^8.3CI failing

Since May 30Pushed 1mo agoCompare

[ Source](https://github.com/tobya/laravel-version)[ Packagist](https://packagist.org/packages/tobya/laravel-version)[ RSS](/packages/tobya-laravel-version/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (18)Versions (4)Used By (0)

 [![Latest Version on Packagist](https://camo.githubusercontent.com/56fbc6c7cf8b0c24ef6c6e6cab8655fdd020612976f88611a9baadfbd1555dfa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f6279612f6c61726176656c2d76657273696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tobya/laravel-version) [![Total Downloads](https://camo.githubusercontent.com/acda5b3820421363b57fbd1b1c90642981217b952eb6ba2201345ae508cd8624/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f6279612f6c61726176656c2d76657273696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tobya/laravel-version)

Laravel Version
===============

[](#laravel-version)

Semantic versioning for Laravel applications with git integration.

History
-------

[](#history)

This is based on eznix86/laravel-version at  . However I required some changes that did not align so i have created this version.

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

[](#installation)

```
composer require tobya/laravel-version
```

Publish the configuration and version file:

```
php artisan vendor:publish --tag=version-config
php artisan vendor:publish --tag=version-json
```

Usage
-----

[](#usage)

### Commands

[](#commands)

```
# Show current version
php artisan version:show

# Bump version
php artisan version:bump patch      # 1.0.0 → 1.0.1
php artisan version:bump minor      # 1.0.0 → 1.1.0
php artisan version:bump major      # 1.0.0 → 2.0.0

# Pre-release versions
php artisan version:bump alpha      # 1.0.0 → 1.0.0-alpha.1
php artisan version:bump beta       # 1.0.0 → 1.0.0-beta.1
php artisan version:bump rc         # 1.0.0 → 1.0.0-rc.1

# With build metadata
php artisan version:bump patch --build=123              # 1.0.0 → 1.0.1+123
php artisan version:bump minor --build=$(git rev-parse --short HEAD)

# Skip git commit/tag
php artisan version:bump patch --no-git

# Set version to specific value
php artisan version:set 2.0.0         # Set version to 2.0.0
php artisan version:set 1.2.3-alpha.1  # Set version with pre-release
php artisan version:set 1.0.0+build.1  # Set version with build metadata
php artisan version:set 2.1.0 --no-git  # Skip git integration

# Set version from latest git tag
php artisan version:set --match-git-tags            # Use latest git tag as version (commits, doesn't create tag)
php artisan version:set --match-git-tags --no-git   # Use latest git tag but skip commit/tag
```

### Helper

[](#helper)

```
// Mirrors the Version Facade

version()->get();              // "1.0.0"
version()->major();            // 1
version()->minor();            // 0
version()->patch();            // 0
version()->preRelease();       // null or "alpha.1"
version()->build();            // null or "123"
version()->isStable();         // true
version()->isPreRelease();     // false

// Comparisons
version()->gt('0.9.0');                  // true
version()->isGreaterThan('0.9.0');       // true (alias of gt)
version()->gte('1.0.0');                 // true
version()->isGreaterThanOrEqualTo('1.0.0'); // true (alias of gte)
version()->lt('2.0.0');                  // true
version()->isLessThan('2.0.0');          // true (alias of lt)
version()->lte('1.0.0');                 // true
version()->isLessThanOrEqualTo('1.0.0'); // true (alias of lte)
version()->eq('1.0.0');                  // true
version()->isCompatibleWith('1.0.0');    // true (alias of eq)
version()->neq('2.0.0');                 // true
version()->isNotEqualTo('2.0.0');        // true (alias of neq)
```

### Blade

[](#blade)

```
@version
```

The `@version` directive automatically includes the configured prefix.

### Facade

[](#facade)

```
use Tobya\Version\Facades\Version;

Version::get();
Version::incrementMinor();
```

Configuration
-------------

[](#configuration)

```
// config/version.php
return [

    /*
    |--------------------------------------------------------------------------
    | Version Prefix
    |--------------------------------------------------------------------------
    |
    | This value is prepended to the version string when using the @version
    | Blade directive. Set to an empty string to disable the prefix.
    |
    */

    'prefix' => 'v',

    /*
    |--------------------------------------------------------------------------
    | Git Integration
    |--------------------------------------------------------------------------
    |
    | When enabled, version bumps will automatically create a git commit and
    | tag. You can customize the commit message and tag format using the
    | {version} placeholder which will be replaced with the new version.
    |
    */

    'git' => [
        'enabled' => true,
        'commit_message' => 'Bump version to {version}',
        'tag_format' => 'v{version}',
    ],

];
```

Artisan About
-------------

[](#artisan-about)

The package automatically registers the version in Laravel's `about` command:

```
php artisan about
```

This will display your application version in the Application section.

Production Protection
---------------------

[](#production-protection)

To prevent accidental version changes in production, add this to your `AppServiceProvider`:

```
use Tobya\Version\Version;

public function boot(): void
{
    Version::prohibitCommands($this->app->isProduction());
}
```

Or prohibit commands individually:

```
use Tobya\Version\Commands\VersionBumpCommand;
use Tobya\Version\Commands\VersionSetCommand;

public function boot(): void
{
    VersionBumpCommand::prohibit($this->app->isProduction());
    VersionSetCommand::prohibit($this->app->isProduction());
}
```

License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance92

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.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 ~7 days

Total

3

Last Release

40d ago

PHP version history (2 changes)v103PHP ^8.3

v103.2PHP ^8.1|^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/a881e781ccf5267bc2c9153c0485a6b7b0fbfeaf212dcfcca6a4dd18885a48ee?d=identicon)[tobya](/maintainers/tobya)

---

Top Contributors

[![eznix86](https://avatars.githubusercontent.com/u/26553194?v=4)](https://github.com/eznix86 "eznix86 (14 commits)")[![tobya](https://avatars.githubusercontent.com/u/325502?v=4)](https://github.com/tobya "tobya (4 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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