mirror of
https://github.com/alexjustesen/speedtest-tracker.git
synced 2026-06-23 07:20:09 +00:00
ce21ae24db
Co-authored-by: Shift <shift@laravelshift.com>
43 lines
976 B
PHP
43 lines
976 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Models\Result;
|
|
use App\Settings\InfluxDbSettings;
|
|
use Illuminate\Console\Command;
|
|
|
|
class TestInfluxDB extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'app:test-influxdb';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Write a test log to InfluxDB to make sure the config works.';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*/
|
|
public function handle(InfluxDbSettings $settings): void
|
|
{
|
|
$influxdb = [
|
|
'enabled' => $settings->v2_enabled,
|
|
'url' => $settings?->v2_url,
|
|
'org' => $settings?->v2_org,
|
|
'bucket' => $settings?->v2_bucket,
|
|
'token' => $settings?->v2_token,
|
|
];
|
|
|
|
if ($influxdb['enabled'] == true) {
|
|
$result = Result::factory()->create();
|
|
}
|
|
}
|
|
}
|