PHPackages                             avto-dev/app-version-laravel - 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. avto-dev/app-version-laravel

ActiveLibrary

avto-dev/app-version-laravel
============================

Laravel applications versioning

v3.8.0(10mo ago)2549.4k—9.1%8[1 PRs](https://github.com/avto-dev/app-version-laravel/pulls)2MITPHPPHP ^8.2CI passing

Since Mar 17Pushed 10mo agoCompare

[ Source](https://github.com/avto-dev/app-version-laravel)[ Packagist](https://packagist.org/packages/avto-dev/app-version-laravel)[ RSS](/packages/avto-dev-app-version-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (20)Used By (2)

 [![Laravel](https://camo.githubusercontent.com/640c3d52b2764f179ef3cf089b604516a8c4ac0a06f055a46c6a7fce9428b787/68747470733a2f2f6c61726176656c2e636f6d2f6173736574732f696d672f636f6d706f6e656e74732f6c6f676f2d6c61726176656c2e737667)](https://camo.githubusercontent.com/640c3d52b2764f179ef3cf089b604516a8c4ac0a06f055a46c6a7fce9428b787/68747470733a2f2f6c61726176656c2e636f6d2f6173736574732f696d672f636f6d706f6e656e74732f6c6f676f2d6c61726176656c2e737667)

AppVersion for Laravel applications
===================================

[](#appversion-for-laravel-applications)

[![Version](https://camo.githubusercontent.com/885efcf1b9bdb054dbf6a5689c00f6a9deb45a9162637c4b017caefa7745de51/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6176746f2d6465762f6170702d76657273696f6e2d6c61726176656c2e7376673f6d61784167653d313830)](https://packagist.org/packages/avto-dev/app-version-laravel)[![PHP Version](https://camo.githubusercontent.com/600549cdb0d0b109e9fd7eb943c94a2adcaeade40cf3c4f1834d79942743c5d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6176746f2d6465762f6170702d76657273696f6e2d6c61726176656c2e7376673f6c6f6e6743616368653d74727565)](https://packagist.org/packages/avto-dev/app-version-laravel)[![Build Status](https://camo.githubusercontent.com/3d464d6821f345e177517b5817a42e1a4c6157f1a24331ff21e9ee0f7a25735c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6176746f2d6465762f6170702d76657273696f6e2d6c61726176656c2f74657374732e796d6c)](https://github.com/avto-dev/app-version-laravel/actions)[![Coverage](https://camo.githubusercontent.com/a6a68b31995c7f7befab27e468773fb5e0bdb14497b828b6840a49812c08ee7b/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6176746f2d6465762f6170702d76657273696f6e2d6c61726176656c2f6d61737465722e7376673f6d61784167653d3630)](https://codecov.io/gh/avto-dev/app-version-laravel/)[![Downloads count](https://camo.githubusercontent.com/af31d75dca09033c07ee6a0444f60bc81442b41c3ecde0513f33874466cadaa7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6176746f2d6465762f6170702d76657273696f6e2d6c61726176656c2e7376673f6d61784167653d313830)](https://packagist.org/packages/avto-dev/app-version-laravel)[![License](https://camo.githubusercontent.com/222dbc0a3ea79c85bfb6aa43321d1724a7c5615e19f21d1d7d207520452adade/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6176746f2d6465762f6170702d76657273696f6e2d6c61726176656c2e7376673f6c6f6e6743616368653d74727565)](https://github.com/avto-dev/app-version-laravel/blob/master/LICENSE)

[![screenshot](https://camo.githubusercontent.com/32d08f09ce9927e868bc40b49a7133b750cd227990e4881da86c4cdbc0900010/68747470733a2f2f686162726173746f726167652e6f72672f776562742f656f2f78762f36722f656f787636726b5f5f3136656237766d696e6a73726831356e716f2e706e67)](https://camo.githubusercontent.com/32d08f09ce9927e868bc40b49a7133b750cd227990e4881da86c4cdbc0900010/68747470733a2f2f686162726173746f726167652e6f72672f776562742f656f2f78762f36722f656f787636726b5f5f3136656237766d696e6a73726831356e716f2e706e67)

> Picture taken from `antonioribeiro/version` repository

Laravel does not have included mechanism for a working with application version, and this package can fix this flaw.

Install
-------

[](#install)

Require this package with composer using the following command:

```
$ composer require avto-dev/app-version-laravel "^3.0"
```

> Installed `composer` is required ([how to install composer](https://getcomposer.org/download/)).

> You need to fix the major version of package.

After that you should "publish" configuration file (`./config/version.php`) using next command:

```
$ php artisan vendor:publish --provider="AvtoDev\\AppVersion\\ServiceProvider"
```

Usage
-----

[](#usage)

This package provides application version manager (`AppVersionManager`) and:

- Version value repositories *(abstraction layer above version data)*
- Repository drivers *(also known as "factories" - they creates configured repository instance)*

> You can write your own implementations, and use them (only correct configuration is required).

Built-in "storage" types:

- Plain file with version definition;
- Application configuration file (`version.config` by default);
- `CHANGELOG.md` file (extracts last defined version value).

If you wanna get access to the version manager using DI - just request `AvtoDev\AppVersion\AppVersionManagerInterface`:

```
