1. Go to this page and download the library: Download gdn-dev/laragit-version library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gdn-dev / laragit-version example snippets
use GenialDigitalNusantara\LaragitVersion\Facade as LaragitVersion;
// Get version with default formatting
echo LaragitVersion::show(); // "Version 1.0.0"
// Get compact version
echo LaragitVersion::show('compact'); // "v1.0.0"
// Get version info as array
$info = LaragitVersion::getVersionInfo();
// Create VERSION file in project root
file_put_contents(base_path('VERSION'), '2.1.0');
// Use normally
echo LaragitVersion::show(); // "Version 2.1.0"
echo LaragitVersion::show('compact'); // "v2.1.0"
// Via service container
$version = app('gdn-dev.laragit-version')->show();
// Via dependency injection
public function __construct(LaragitVersion $laragitVersion)
{
$this->version = $laragitVersion->show();
}