Looking to hire Laravel developers? Try LaraJobs

laravel-git-version maintained by mathewparet

Description
Get the application version using git or a fallback
Author
Last update
2023/12/14 11:32 (dev-master)
License
Downloads
182

Comments
comments powered by Disqus

mathewparet/laravel-git-version

Get version number from git or fallback

Installation

composer require mathewparet/laravel-git-version
sail artisan vendor:publish --tag=laravel-git-version

Usage

To get the application version:

// config/git.php
use mathewparet\LaravelGitVersion\Git\GitVersion;

/**
 * Example #1 - get version from git,
 * or fallback and read the contents of the 
 * `.current_version` file in the application 
 * root.
 */
'version' => GitVersion::version();


/**
 * Example #2 - get version from git,
 * or fallback and run the closure.
 */
'version' => GitVersion::version(function() {
    return env('APP_VERSION');
});