PHPackages                             mhapach/projectversions - 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. mhapach/projectversions

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

mhapach/projectversions
=======================

vcs control of project

0.0.18(3y ago)0190MITPHP

Since May 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mhapach/projectversions)[ Packagist](https://packagist.org/packages/mhapach/projectversions)[ RSS](/packages/mhapach-projectversions/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (10)DependenciesVersions (20)Used By (0)

ProjectVersions
===============

[](#projectversions)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cb8184b01fd971343536e31395c23ce7c8558e2203c2651b984b64111cff31d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6861706163682f70726f6a65637476657273696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mhapach/projectversions)[![Total Downloads](https://camo.githubusercontent.com/5c807c3417675d24be5fe51794871101da140d33501c7d46cd8553d5de0a80f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6861706163682f70726f6a65637476657273696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mhapach/projectversions)[![Build Status](https://camo.githubusercontent.com/ee5ce7db6c3cd9885a0ef39c19303a307e3aefb77d76a22f4b7ac0cc7ceff1e3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d6861706163682f70726f6a65637476657273696f6e732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/mhapach/projectversions)[![StyleCI](https://camo.githubusercontent.com/cb13a877afd1dbe223c631789c3f922d3ace958fdb334a9cce9b26afefbc2ebd/68747470733a2f2f7374796c6563692e696f2f7265706f732f31323334353637382f736869656c64)](https://styleci.io/repos/12345678)

This package is a Laravel (7.0+) utility which helps you keep and manage your project version(increment major, minor version numbers )

And also there is a UI for version checkout from VCS (only git based for a while )

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

[](#installation)

Before install you need to be sure that git installed on your host

Step 1. Add Eloquent Model Generator to your project via Composer

```
$ composer require mhapach/projectversions
```

Set in .env next values

```
- optional fields
``` bash
#if you will not set it you will be propted to enter you account in Authorisation form for VCS in UI
VCS_LOGIN=Yourlogin
VCS_PASSWORD=YourPassword

#if it true you then access to UI will be through auth middleware, so only authorised users will able to update project
VCS_USE_AUTH_MIDDLEWARE=true

#if VCS_USE_AUTH_MIDDLEWARE is true then in this field enter comma separated ids of users allowed to checkout and update project from VCS
VCS_UPDATE_USERS=1,3

```

Step 2. Register ProjectVersionsServiceProvider in config/app.php

```
'providers' => [
    //...
    \mhapach\ProjectVersions\ProjectVersionsServiceProvider::class,
]

```

Usage
-----

[](#usage)

### Use project version in your code. It's very useful when you need prevent loading of js of css libs from cache

[](#use-project-version-in-your-code-its-very-useful-when-you-need-prevent-loading-of-js-of-css-libs-from-cache)

```
Example 1 - getting current version number
print  app('project.version');

Example 2 - usage within blade code

```

### Easily increment your version numbers, using Artisan commands

[](#easily-increment-your-version-numbers-using-artisan-commands)

```
php artisan pv:commit

Which should commit last changes into VCS and print the new version number in file
project.info in root folder of project

```

### Make diff zip archive between to commits or using number of last commits

[](#make-diff-zip-archive-between-to-commits-or-using-number-of-last-commits)

```
php artisan pv:archive --help
Shows you arguments and options of command pv:archive

Example 1 - make zip archive between to commits
php artisan pv:archive commit_hash1 commit_hash2

Example 2 - make zip archive for last 10 commits
php artisan pv:archive -s 10

Example 3 - make zip archive for last 10 commits and specify path of archive file
php artisan pv:archive -s 10 -p storage/app/git_archives
or
php artisan pv:archive --shift=10 --path=storage/app/git_archives

```

#### Example of project.info file

[](#example-of-projectinfo-file)

```
---
{
    "Project": "Your megaproject",
    "Description": "New build commit",
    "Date": "2022-09-02 11:42:09",
    "Version": "1.1.2.12345"
}

```

#### Examples of usage artisan commands (attention run all examples from root folder of project:

[](#examples-of-usage-artisan-commands-attention-run-all-examples-from-root-folder-of-project)

```
Example 1 (source version 1.1.2.12345-Beta)
Command: php artisan pv:commit versionNumber (the same as: php artisan pv:commit versionNumber=+1)
Result:  changes will be commited with descrition "New build commit. Version: 2.0.0.12346-Pre-Alfa"
         In svn trunk will be coppied to folder tags with name of new version 2.0.0.1-Pre-Alfa

Example 2 (source version 1.1.2.12345-Beta)
Command: php artisan pv:commit versionNumber=3
Result: changes will be commited with descrition "New build commit. 3.1.2.12346-Beta"
        In svn trunk will be coppied to folder tags with name of new version 3.1.2.12346-Beta

Example 3 (source version 1.1.2.12345-Beta)
Command: php artisan pv:commit releaseNumber (the same as: php artisan pv:commit releaseNumber=+1)
Result: changes will be commited with descrition "New build commit. Version: 1.2.0.1-Pre-Alfa"
        In svn trunk will be coppied to folder tags with name of new version 1.2.0.1-Pre-Alfa

Example 4 (source version 1.1.2.12345-Beta)
Command: php artisan pv:commit buildNumber (the same as: php artisan pv:commit buildNumber=+1)
Result: changes will be commited with descrition "New build commit. Version: 1.1.3.1-Beta

Example 5 (source version 1.1.2.12345-Beta)
Command: php artisan pv:commit releaseType (the same as: php artisan pv:commit releaseType=+1)
Result: changes will be commited with descrition "New build commit. Version: 1.1.2.12346-Release-Candidate

Example 6 (source version 1.1.2.12345-Beta)
Command: php artisan pv:commit releaseType="Release"
Result: changes will be commited with descrition "New build commit. Version: 1.1.2.12346-Release

```

### Rollback at previous project versions or checkout latest commited version.

[](#rollback-at-previous-project-versions-or-checkout-latest-commited-version)

It very useful at dev servers where you testing your project and want to make regression testing.

```
UI interface address
http://yourproject/project_versions

```

### Find out if newest version exists by ajax request - get the json response and use it your javascript

[](#find-out-if-newest-version-exists-by-ajax-request---get-the-json-response-and-use-it-your-javascript)

```
http://yourproject/project_versions/new

```

### Checkout latest VCS version - get the json response and use it your javascript, this command will update tour project till last version

[](#checkout-latest-vcs-version----get-the-json-response-and-use-it-your-javascript-this-command-will-update-tour-project-till-last-version)

```
http://yourproject/project_versions/update

```

### Get current version of project

[](#get-current-version-of-project)

```
http://yourproject/project_versions/version

```

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits
-------

[](#credits)

- [author name](https://github.com/mhapach)
- [All Contributors](../../contributors)

License
-------

[](#license)

license. Please see the [license file](license.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~51 days

Recently: every ~23 days

Total

19

Last Release

1260d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6570258?v=4)[mhapach](/maintainers/mhapach)[@mhapach](https://github.com/mhapach)

---

Top Contributors

[![mhapach](https://avatars.githubusercontent.com/u/6570258?v=4)](https://github.com/mhapach "mhapach (17 commits)")

---

Tags

laravelcontrolprojectversionvcs

### Embed Badge

![Health badge](/badges/mhapach-projectversions/health.svg)

```
[![Health](https://phpackages.com/badges/mhapach-projectversions/health.svg)](https://phpackages.com/packages/mhapach-projectversions)
```

###  Alternatives

[pragmarx/version

Take control over your Laravel app version

5921.2M2](/packages/pragmarx-version)

PHPackages © 2026

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