From 8bdba2ad8f7d464f70229a84d472ae4a377b3dce Mon Sep 17 00:00:00 2001 From: Tajim Date: Sat, 29 Aug 2026 14:36:11 +0600 Subject: [PATCH] feat(core): auto-detect application version from git tag --- .env.example | 1 - config/app.php | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index d049a24..6b66104 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,6 @@ APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost -APP_VERSION=v2.1.0 APP_LOCALE=en APP_FALLBACK_LOCALE=en diff --git a/config/app.php b/config/app.php index e441955..9f643c0 100644 --- a/config/app.php +++ b/config/app.php @@ -15,7 +15,10 @@ 'name' => env('APP_NAME', 'Laravel'), - 'version' => env('APP_VERSION', 'v2.1.0'), + 'version' => env('APP_VERSION') + ?: (file_exists(base_path('version.txt')) ? trim((string) file_get_contents(base_path('version.txt'))) : null) + ?: trim((string) @exec('git describe --tags --abbrev=0 2>/dev/null')) + ?: 'v2.5.0', /* |--------------------------------------------------------------------------