Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/views/partials/footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
    

@if(config('admin.show_version'))
<strong>Version</strong>&nbsp;&nbsp; {!! \Ladmin\Admin::VERSION !!}
<strong>Version</strong>&nbsp;&nbsp; {!! \Ladmin\Admin::getVersion() !!}
@endif

</div>
Expand Down
15 changes: 13 additions & 2 deletions src/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Ladmin;

use Closure;
use Composer\InstalledVersions;
use Ladmin\Auth\Database\Menu;
use Ladmin\Controllers\AuthController;
use Ladmin\Layout\Content;
Expand All @@ -25,7 +26,7 @@ class Admin
*
* @var string
*/
const VERSION = '1.8.17';
const PACKAGE_NAME = 'php-panel/laravel-admin';

/**
* @var Navbar
Expand Down Expand Up @@ -69,7 +70,17 @@ class Admin
*/
public static function getLongVersion()
{
return sprintf('Laravel-admin <comment>version</comment> <info>%s</info>', self::VERSION);
return sprintf('Laravel-admin <comment>version</comment> <info>%s</info>', self::getVersion());
}

/**
* Returns the version of Laravel-admin.
*
* @return string The application version
*/
public static function getVersion()
{
return InstalledVersions::getPrettyVersion(self::PACKAGE_NAME) ?? '0.0.0-dev';
}

/**
Expand Down