Where to specify the version of the application in the Laravel application?

I used to indicate the version of the application inside composer.json until I read somewhere here on Stack Overflow that this was bad practice. What is the standard file for indicating the version of an application in a PHP Laravel application? (i.e. in .NET , which will be the configuration file, in iOS it will be info.plist, on Android d - the manifest, etc.)

+7
php laravel laravel-5
source share
2 answers

config/app.php definitely the place for such information.

Why? Because configuration files (or should be included) are included in the version stream, and they (should) contain insensitive information about your application. Ideal place for a simple version indicator.

under the index name array, you can set the version index like this

 /* |-------------------------------------------------------------------------- | Application Version |-------------------------------------------------------------------------- | | This value is the version of your application. This value is used when | the framework needs to place the application version in a notification | or any other location as required by the application or its packages. */ 'version' => '1.0', 
+14
source share

I usually install it in my .ENV file and then select it in the config.

e.g...env says:

 APP_VERSION=2.1 

config / app.php says:

 'version' => env('APP_VERSION', '0.0.1-alpha'), 
+1
source share

All Articles