mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-10-07 21:33:18 +01:00
Add check for premium to telemetry and update lookup
This commit is contained in:
committed by
Constantin Graf
parent
06a2048771
commit
12cc3f27f8
@@ -15,12 +15,18 @@ use App\Models\User;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Log;
|
||||
use Nwidart\Modules\Facades\Module;
|
||||
use Throwable;
|
||||
|
||||
class ApiService
|
||||
{
|
||||
private const string API_URL = 'https://app.solidtime.io/api/v1';
|
||||
|
||||
private function isPremium(): bool
|
||||
{
|
||||
return Module::has('Invoicing');
|
||||
}
|
||||
|
||||
public function checkForUpdate(): ?string
|
||||
{
|
||||
try {
|
||||
@@ -31,6 +37,7 @@ class ApiService
|
||||
'version' => config('app.version'),
|
||||
'build' => config('app.build'),
|
||||
'url' => config('app.url'),
|
||||
'is_premium' => $this->isPremium(),
|
||||
]);
|
||||
|
||||
if ($response->status() === 200 && isset($response->json()['version']) && is_string($response->json()['version'])) {
|
||||
@@ -62,6 +69,7 @@ class ApiService
|
||||
'version' => config('app.version'),
|
||||
'build' => config('app.build'),
|
||||
'url' => config('app.url'),
|
||||
'is_premium' => $this->isPremium(),
|
||||
// telemetry data
|
||||
'user_count' => User::count(),
|
||||
'organization_count' => Organization::count(),
|
||||
|
||||
Reference in New Issue
Block a user