cache the info
This commit is contained in:
parent
e33c1ac66f
commit
371ec3084f
@ -13,7 +13,13 @@ class Info
|
|||||||
{
|
{
|
||||||
public static function all()
|
public static function all()
|
||||||
{
|
{
|
||||||
return array_merge(static::versions(), [
|
static $info = [];
|
||||||
|
|
||||||
|
if (! empty($info)) {
|
||||||
|
return $info;
|
||||||
|
}
|
||||||
|
|
||||||
|
$info = array_merge(static::versions(), [
|
||||||
'api_key' => setting('apps.api_key'),
|
'api_key' => setting('apps.api_key'),
|
||||||
'ip' => static::ip(),
|
'ip' => static::ip(),
|
||||||
'companies' => Company::count(),
|
'companies' => Company::count(),
|
||||||
@ -22,11 +28,19 @@ class Info
|
|||||||
'customers' => Contact::customer()->count(),
|
'customers' => Contact::customer()->count(),
|
||||||
'php_extensions' => static::phpExtensions(),
|
'php_extensions' => static::phpExtensions(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
return $info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function versions()
|
public static function versions()
|
||||||
{
|
{
|
||||||
return [
|
static $versions = [];
|
||||||
|
|
||||||
|
if (! empty($versions)) {
|
||||||
|
return $versions;
|
||||||
|
}
|
||||||
|
|
||||||
|
$versions = [
|
||||||
'akaunting' => version('short'),
|
'akaunting' => version('short'),
|
||||||
'laravel' => InstalledVersions::getPrettyVersion('laravel/framework'),
|
'laravel' => InstalledVersions::getPrettyVersion('laravel/framework'),
|
||||||
'php' => static::phpVersion(),
|
'php' => static::phpVersion(),
|
||||||
@ -35,6 +49,8 @@ class Info
|
|||||||
'livewire' => InstalledVersions::getPrettyVersion('livewire/livewire'),
|
'livewire' => InstalledVersions::getPrettyVersion('livewire/livewire'),
|
||||||
'omnipay' => InstalledVersions::getPrettyVersion('league/omnipay'),
|
'omnipay' => InstalledVersions::getPrettyVersion('league/omnipay'),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
return $versions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function phpVersion()
|
public static function phpVersion()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user