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

ActiveLibrary

apavliukov/app-version-laravel
==============================

Laravel applications versioning

v3.4.1(3y ago)0490MITPHPPHP ^7.3 || ^8.0

Since Mar 17Pushed 3y agoCompare

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

READMEChangelog (2)Dependencies (9)Versions (17)Used By (0)

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

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

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

Laravel 9 ready
---------------

[](#laravel-9-ready)

[![Version](https://camo.githubusercontent.com/39ab192ec50e8665e411796be688074862e85c9b1c1fcb43393d33558fd7865f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617061766c69756b6f762f6170702d76657273696f6e2d6c61726176656c2e7376673f6d61784167653d313830)](https://packagist.org/packages/apavliukov/app-version-laravel)[![PHP Version](https://camo.githubusercontent.com/81c4e8c8ab237c5dfb636d5cc04928a9e4fbad645db4be4b2968a4a563b36340/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f617061766c69756b6f762f6170702d76657273696f6e2d6c61726176656c2e7376673f6c6f6e6743616368653d74727565)](https://packagist.org/packages/apavliukov/app-version-laravel)[![Build Status](https://camo.githubusercontent.com/2bd5e70d1d09728f26f5a672c2f2236346d743e2a00cd09ba32b6f8d41517e7c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f617061766c69756b6f762f6170702d76657273696f6e2d6c61726176656c2f74657374732f6d6173746572)](https://github.com/apavliukov/app-version-laravel/actions)[![Coverage](https://camo.githubusercontent.com/2b07d165aa5fe447942a1890e7e9d6ce3e64857f50b167338936faff39b487f1/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f617061766c69756b6f762f6170702d76657273696f6e2d6c61726176656c2f6d61737465722e7376673f6d61784167653d3630)](https://codecov.io/gh/apavliukov/app-version-laravel/)[![Downloads count](https://camo.githubusercontent.com/d15a06d40c82128543495bc43fea0684125b4f049b074e4bc7a8219c78002aa6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617061766c69756b6f762f6170702d76657273696f6e2d6c61726176656c2e7376673f6d61784167653d313830)](https://packagist.org/packages/apavliukov/app-version-laravel)[![License](https://camo.githubusercontent.com/d28e4d6a17e701426a421dc964d5504ce4bf0875e9e7622dd0c29fa7876322ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f617061766c69756b6f762f6170702d76657273696f6e2d6c61726176656c2e7376673f6c6f6e6743616368653d74727565)](https://github.com/apavliukov/app-version-laravel/blob/master/LICENSE)

[![screenshot](https://camo.githubusercontent.com/af6f26fc960e4f4faa4bc5f18111e6c68f5f009a40bb911f0359a35342c827e9/68747470733a2f2f6873746f2e6f72672f776562742f6a6c2f65632f31792f6a6c65633179667a31365f3663676d6a7037666a76396b7272726f2e706e67)](https://camo.githubusercontent.com/af6f26fc960e4f4faa4bc5f18111e6c68f5f009a40bb911f0359a35342c827e9/68747470733a2f2f6873746f2e6f72672f776562742f6a6c2f65632f31792f6a6c65633179667a31365f3663676d6a7037666a76396b7272726f2e706e67)

> 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 apavliukov/app-version-laravel
```

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`:

```
