Download the PHP package j2nlab/laravel-simple-version without Composer
On this page you can find all versions of the php package j2nlab/laravel-simple-version. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download j2nlab/laravel-simple-version
More information about j2nlab/laravel-simple-version
Files in j2nlab/laravel-simple-version
Package laravel-simple-version
Short Description Manage easily your Laravel app version
License MIT
Homepage https://github.com/J2Nlab/laravel-simple-version
Informations about the package laravel-simple-version
Laravel-Simple-Version
Manage easily your Laravel app version
Requires PHP 8.1+ and Laravel 10, 11 or 12. For Laravel 6, 7 or 8, use version 1.2.
Description
With this package, you can:
- print a version on a page;
- print it in the console, via an artisan command;
- increments version number, via an artisan command.
Installation
Via Composer
Then publish the configuration file:
The initial config/version.php is:
If build is false, then this number is ignored; else it's incremented and never reset to 0.
If you want a build number, set to any value (0 or 1, for example).
If commit is false, this number is ignored; else get the first 6 digits of the last local commit.
If you want a commit number, set it to any value (0 or 1, for example).
Artisan commands
All available commands are:
php artisan version
Display version number, in different ways available with helpers and Blade directive, currently 'full' and 'compact' (the default).
Or, if build value is false.
Or, if build and commit values are false.
Or, if patch and build values are false.
php artisan version:commit
If the commit value on config/version.php is not false, get the first 6 digits of the last git local commit.
Or, if commit value is false.
php artisan version:build
If the build value on config/version.php is not false, increment build number.
This number is never reset to 0.
Or, if build value is false.
php artisan version:patch
If the patch value on config/version.php is not false, increment app patch number.
Or, if patch value is false.
php artisan version:minor
Increment app minor number version. The patch number is reset to 0, unless it has been disabled (false), in which case it stays disabled.
php artisan version:major
Increment app major number version. The minor number is reset to 0, and the patch number is reset to 0 unless it has been disabled (false).
Summary...
It's really simple:
'major' => 0,is incremented byversion:major'minor' => 0,is incremented byversion:minor, reset to 0 byversion:major'patch' => 0,is incremented byversion:patch, reset to 0 byversion:major/minor'patch' => false,is never incremented, and staysfalseonversion:major/minor'build' => 0,is incremented byversion:build'build' => false,is never incremented'commit' => 0,is set with first 6 digits of last git commit byversion:commit'commit' => false,is never fetched
Helper
You can use this helper to get a compact version format:
Or you can choose the format:
Any unknown format falls back to compact.
Blade directive
You can use this directive to render a compact version format:
Or you can choose the format:
Testing
You can run some PHPunit tests with the following command:
License
This package is licensed under the MIT License - see the LICENSE file for details.
All versions of laravel-simple-version with dependencies
illuminate/console Version ^10.0|^11.0|^12.0
illuminate/view Version ^10.0|^11.0|^12.0
symfony/process Version ^6.0|^7.0