diff --git a/README.md b/README.md index 2c5352a..4d51872 100755 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This package is a Laravel wrapper for the [influxdb-php](https://packagist.org/p ## Installation -This package requires PHP 7.4+, Laravel 8+ and works with InfluxDB 2.0. For InfluxDB 1.x, see the [1.x setup instructions in the next section](#influxdb-1x). +This package requires PHP 7.4+, Laravel 8+ and works with InfluxDB 2.0/1.8+. For InfluxDB 1.7 or earlier, see the [1.x setup instructions in the next section](#influxdb-1x). 1. To install the latest version of the package, run the following command in your terminal: @@ -83,11 +83,9 @@ use GeTracker\InfluxDBLaravel\InfluxDBManager; class Foo { - /** @var InfluxDBManager */ - protected $influxDb; - - public function __construct(InfluxDBManager $influxDb) - { + public function __construct( + protected InfluxDBManager $influxDb + ) { $this->influxDB = $influxDB; } diff --git a/composer.json b/composer.json index d07bd8b..884bd97 100755 --- a/composer.json +++ b/composer.json @@ -7,9 +7,10 @@ "graham-campbell/manager": "^5.0", "illuminate/contracts": "^8.0|^9.0|^10.0", "illuminate/support": "^8.0|^9.0|^10.0", - "influxdata/influxdb-client-php": "^2.6" + "influxdata/influxdb-client-php": "^3.4" }, "require-dev": { + "guzzlehttp/guzzle": "^7.0.1", "orchestra/testbench": "^6.0|^7.0|^8.0" }, "license": "MIT", @@ -28,7 +29,10 @@ "prefer-stable": true, "config": { "sort-packages": true, - "preferred-install": "dist" + "preferred-install": "dist", + "allow-plugins": { + "php-http/discovery": true + } }, "extra": { "laravel": { diff --git a/config/influxdb.php b/config/influxdb.php index e1bcd79..73c6488 100644 --- a/config/influxdb.php +++ b/config/influxdb.php @@ -33,6 +33,7 @@ 'org' => env('INFLUXDB_ORG'), 'verifySSL' => env('INFLUXDB_VERIFY_SSL', false), 'precision' => env('INFLUXDB_PRECISION', 'ns'), + 'debug' => env('INFLUXDB_DEBUG', false), ], ], diff --git a/src/InfluxDBFactory.php b/src/InfluxDBFactory.php index f7be4d7..34c401d 100644 --- a/src/InfluxDBFactory.php +++ b/src/InfluxDBFactory.php @@ -23,6 +23,7 @@ public function make(array $config): Client 'org' => $config['org'], 'verifySSL' => $config['verifySSL'], 'precision' => $config['precision'], + 'debug' => $config['debug'] ?? false, ]); } }