PHPackages                             codimais/appver - 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. codimais/appver

ActiveLibrary

codimais/appver
===============

Controls semantic versioning of your Laravel application with easy

1.0.7(1y ago)0824MITPHPPHP ^7.4|^8.0

Since Oct 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lantonello/appver)[ Packagist](https://packagist.org/packages/codimais/appver)[ Docs](https://github.com/codimais/appver)[ RSS](/packages/codimais-appver/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (4)Versions (10)Used By (0)

AppVer
======

[](#appver)

[![Latest Version on Packagist](https://camo.githubusercontent.com/87b49cf20f67972fd060214ec97f24e9c3c2feffcc7c8213ed8d479c1006ef3e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64696d6169732f6170707665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codimais/appver)[![Total Downloads](https://camo.githubusercontent.com/c54a42a9770748555e1bb2813182f8caf1c59792c28efcf16d9584280db44426/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f64696d6169732f6170707665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codimais/appver)[![GitHub Actions](https://github.com/codimais/laraversion/actions/workflows/main.yml/badge.svg)](https://github.com/codimais/laraversion/actions/workflows/main.yml/badge.svg)

Controls semantic versioning of your Laravel application with easy!

The main goal of this package is to add automated and independent semantic version control, without the need to use git *tags* or *branches*.

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

[](#installation)

You can install the package via composer:

```
composer require codimais/appver
```

After installing the package in your project, go to the terminal and run the below command to initialize **AppVer**:

```
php artisan appver:init
```

The command will ask if you want to define a specific initial version. You can accept the default, which is **"1.0.0"** or type yours app version.

It will also try to identify if your project has a git repository and, if so, it will offer to create a git hook to automate the version increment.

Usage
-----

[](#usage)

### Auto increment

[](#auto-increment)

If your project has a git repository and if **AppVer** was able to create the *pre-commit hook*, you don't need to do anything.

Before each *commit*, git will run the *pre-commit hook* that will increment the version of your application and add it to the current *commit*, automatically.

### Manual increment

[](#manual-increment)

If your project is not in a git repository or if you do not want to use auto increment, then you can increment the version of your application manually:

```
// To increment the patch number:
php artisan appver:inc --patch
// Output: Version changed from '1.0.0' to '1.0.1'

// To increment the minor version number:
php artisan appver:inc --minor
// Output: Version changed from '1.0.0' to '1.1.0'

// To increment the major version number:
php artisan appver:inc --major
// Output: Version changed from '1.0.0' to '2.0.0'
```

You can combine the increments as you need. The order does not matter.

```
php artisan appver:inc --patch --minor
// Output: Version changed from '1.0.0' to '1.1.1'

php artisan appver:inc --major --minor
// Output: Version changed from '1.0.0' to '2.1.0'

php artisan appver:inc --minor --major --patch
// Output: Version changed from '1.0.0' to '2.1.1'
```

If you need to display the current version in your API or in a View:

```
