diff --git a/app/Utilities/Info.php b/app/Utilities/Info.php index 7dfbfcd12..3fd49a28e 100644 --- a/app/Utilities/Info.php +++ b/app/Utilities/Info.php @@ -4,6 +4,7 @@ namespace App\Utilities; use App\Models\Auth\User; use App\Models\Common\Company; +use Composer\InstalledVersions; use DB; class Info @@ -22,8 +23,12 @@ class Info { return [ 'akaunting' => version('short'), + 'laravel' => app()->version(), 'php' => static::phpVersion(), 'mysql' => static::mysqlVersion(), + 'vuejs' => static::nodePackageVersion('vue'), + 'livewire' => InstalledVersions::getPrettyVersion('livewire/livewire'), + 'tailwindcss' => static::nodePackageVersion('tailwindcss'), ]; } @@ -51,4 +56,16 @@ class Info return 'N/A'; } + + public static function nodePackageVersion($package) + { + $version = '-'; + $shell_exec_result = shell_exec('npm list ' . $package . ' --depth=0'); + + if (!strpos($shell_exec_result, '(empty)')) { + $version = trim(substr($shell_exec_result, strpos($shell_exec_result, $package . '@') + strlen($package) + 1)); + } + + return $version; + } }