-
-
Notifications
You must be signed in to change notification settings - Fork 215
Expand file tree
/
Copy pathTestInfluxDB.php
More file actions
42 lines (36 loc) · 976 Bytes
/
TestInfluxDB.php
File metadata and controls
42 lines (36 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?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();
}
}
}