Laravel artisan command to increment composer.json version.
talevskiigor/composer-bump is a Laravel package for laravel artisan command to increment composer.json version..
It currently has 18 GitHub stars and 73.950 downloads on Packagist (latest version 1.0.8).
Install it with composer require talevskiigor/composer-bump.
Discover more Laravel packages by talevskiigor
or browse all Laravel packages to compare alternatives.
Last updated
Laravel Bump is a package that allows you to easy change your version of your application or package in composer.json file through an Artisan command.
Pretend you have an application or package that you would like to ensure has the right version information in composer.json, you can run php artisan bump to get automatically increase version information.
unknown@Dell-Studio-1747:~/Code/ComposerBump$ php artisan bump
Bump from: 0.0.1 to 0.0.2
unknown@Dell-Studio-1747:~/Code/ComposerBump$
Also has nice Facade to be used in about page or similar where you need to show your application or package version to the customer.
For more information about versioning please visit http://semver.org/
Given a version number MAJOR.MINOR.PATCH, increment the:
php artisan bump:patch Increments PATCH version (major.minor.PATCH => verison 0.0.1)
Example output: Bump from: 0.0.1 to 0.0.2
php artisan bump:minor Bump MINOR version (major.MINOR.patch => verison 0.1.0)
Example output: Bump from: 0.0.2 to 0.1.0
php artisan bump:major Bump MAJOR version (MAJOR.minor.patch => verison 1.0.0)
Example output: Bump from: 0.1.0 to 1.0.0
In your controller you can easy get and return version of your application or package
`return ComposerBump::getVersion();`
composer require talevskiigor/composer-bump
config/app.php and insert the folowing line in Service ProviderTalevskiigor\ComposerBump\ComposerBumpServiceProvider::class,
'ComposerBump'=>Talevskiigor\ComposerBump\Facades\ComposerBump::class,
If you want to use this package for only local development, you don't need to update config/app.php. Instead, you can update provider app/Providers/AppServiceProvider.php, for example:
public function register()
{
if ($this->app->environment() == 'local') {
$this->app->register('Talevskiigor\ComposerBump\ComposerBumpServiceProvider');
}
}
`php artisan bump` - this is alias of `bump:patch`
Package will make backup copy of you composer.json file on each use, so you can easy do undo on changes, simple use undo command as:
`php artisan bump:undo`
Example output:
!!! WARNING !!!!!! WARNING !!!!!! WARNING !!!
This will replace content of: composer.json file with content from file: composer.json-backup !!!
Are you suere? [y|N] (yes/no) [no]:
> yes
Restored file: composer.json-backup into file: composer.json
unknown@Dell-Studio-1747:~/Code/ComposerBump$
Add unit tests for any new or changed functionality. Lint and test your code using PHPUnit.
develop branch (git checkout develop)git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)Copyright (c) MIT license.