File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 99   ;  ;  ;  ;
1010
1111 @if (config (' admin.show_version' ) )
12- <strong >Version</strong >  ;  ; {!! \Ladmin \Admin:: VERSION ! !}
12+ <strong >Version</strong >  ;  ; {!! \Ladmin \Admin:: getVersion () ! !}
1313 @endif
1414
1515 </div >
Original file line number Diff line number Diff line change 33namespace Ladmin ;
44
55use Closure ;
6+ use Composer \InstalledVersions ;
67use Ladmin \Auth \Database \Menu ;
78use Ladmin \Controllers \AuthController ;
89use Ladmin \Layout \Content ;
@@ -25,7 +26,7 @@ class Admin
2526 *
2627 * @var string
2728 */
28- const VERSION = '1.8.17 ' ;
29+ const PACKAGE_NAME = 'php-panel/laravel-admin ' ;
2930
3031 /**
3132 * @var Navbar
@@ -69,7 +70,17 @@ class Admin
6970 */
7071 public static function getLongVersion ()
7172 {
72- return sprintf ('Laravel-admin <comment>version</comment> <info>%s</info> ' , self ::VERSION );
73+ return sprintf ('Laravel-admin <comment>version</comment> <info>%s</info> ' , self ::getVersion ());
74+ }
75+
76+ /**
77+ * Returns the version of Laravel-admin.
78+ *
79+ * @return string The application version
80+ */
81+ public static function getVersion ()
82+ {
83+ return InstalledVersions::getPrettyVersion (self ::PACKAGE_NAME ) ?? '0.0.0-dev ' ;
7384 }
7485
7586 /**
You can’t perform that action at this time.
0 commit comments