Fox's smarter application version manager :)
- PHP >= 8.0.2
- Composer >= 2.0
- Supported Laravel Framework versions: 7.0, 8.0 and 9.0
Use composer to install and use this package in your project.
Install them with
composer require "fox/laravel-application-version"
and you are ready to go!
The service provider will automatically get registered. Or you may manually add the service provider to your config/app.php
file:
'providers' => [
// ...
Fox\Application\Version\ServiceProvider::class,
];
You can use the provided classes directly for your own purpose.
$myVersion = new Fox\Application\Version\Version(1, 0, 23, 'alpha');
echo $myVersion->major();
echo $myVersion->minor();
echo $myVersion->patch();
echo $myVersion->build();
echo (string) $myVersion;
This will generate the following output:
1
0
23
alpha
1.0.23-alpha
You may also use the version manager to determine the current version of your application by parsing
the composer.json file and run git to receive the last commit id of your working directory used as
additional build
information.
$versionManager = app('version-manager');
$myVersion = $versionManager->getCurrentVersion();
See the CONTRIBUTING file.
See the CHANGELOG file.
See the LICENSE file.