Skip to content

Commit

Permalink
updated info
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Sep 21, 2022
1 parent d0f2875 commit 6424b29
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions app/Utilities/Info.php
Expand Up @@ -4,17 +4,22 @@

use App\Models\Auth\User;
use App\Models\Common\Company;
use App\Models\Common\Contact;
use App\Models\Document\Document;
use Composer\InstalledVersions;
use DB;
use Illuminate\Support\Facades\DB;

class Info
{
public static function all()
{
return array_merge(static::versions(), [
'api_key' => setting('apps.api_key'),
'ip' => static::ip(),
'companies' => Company::count(),
'users' => User::count(),
'invoices' => Document::invoice()->count(),
'customers' => Contact::customer()->count(),
'php_extensions' => static::phpExtensions(),
]);
}
Expand All @@ -23,10 +28,12 @@ public static function versions()
{
return [
'akaunting' => version('short'),
'laravel' => app()->version(),
'laravel' => InstalledVersions::getPrettyVersion('laravel/framework'),
'php' => static::phpVersion(),
'mysql' => static::mysqlVersion(),
'guzzle' => InstalledVersions::getPrettyVersion('guzzlehttp/guzzle'),
'livewire' => InstalledVersions::getPrettyVersion('livewire/livewire'),
'omnipay' => InstalledVersions::getPrettyVersion('league/omnipay'),
];
}

Expand Down Expand Up @@ -54,4 +61,11 @@ public static function mysqlVersion()

return 'N/A';
}

public static function ip()
{
return request()->header('CF_CONNECTING_IP')
? request()->header('CF_CONNECTING_IP')
: request()->ip();
}
}
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -28,6 +28,7 @@
"ext-xml": "*",
"ext-zip": "*",
"akaunting/laravel-apexcharts": "^2.0",
"akaunting/laravel-debugbar-collector": "^2.0",
"akaunting/laravel-firewall": "^2.0",
"akaunting/laravel-language": "^1.0",
"akaunting/laravel-menu": "^2.0",
Expand All @@ -37,7 +38,6 @@
"akaunting/laravel-setting": "^1.2",
"akaunting/laravel-sortable": "^1.0",
"akaunting/laravel-version": "^1.0",
"akaunting/laravel-debugbar-collector": "^2.0",
"akaunting/module-offline-payments": "^3.0",
"akaunting/module-paypal-standard": "^3.0",
"barryvdh/laravel-debugbar": "^3.6",
Expand Down

0 comments on commit 6424b29

Please sign in to comment.