Laravel-Version is a small Bash utility to easily add a Semver version tag and update the configuration file(s) within your Laravel application.
- Copy the file
version.sh
to your Laravel project root - Open
version.sh
in a text editor and setRELEASE_BRANCH="main"
to your release branch. Save and close the file. - Make it executable:
chmod +x version.sh
- Create a
config/_app.php
configuration file (see_app.php.example
) - If you have Bugsnag installed, ensure that
- You published the Bugsnag config file (`php artisan vendor:publish`)
- `APP_VERSION` in `config/bugsnag.php` has a default value, i.e. `env('BUGSNAG_APP_VERSION', '0.0.1')`
- Make some changes to your project
- Ensure you are on your release branch
- Run
./version.sh 1.0.0
to update the config files. This will amend the last commit with the updated config files and tag the project with version1.0.0
. - Run
./version.sh
to see the current version
Once you have tagged a version, you can grab the values via config helper:
config('_app.version'); // 1.0.0
config('_app.version_hash'); // 02c8c78
Pull requests are the best way to propose changes to the codebase. I actively welcome your pull requests:
- Fork the repo and create your branch from
main
. - Make your changes.
- Issue that pull request!
In short, when you submit code changes, your submissions are understood to be under the same MIT License that covers the project. Feel free to contact the maintainer if that's a concern.
This project is open-sourced software licensed under the MIT license.