2017 © Pedro Peláez
 

library laravel-influx-provider

Service provider to set up and use InfluxDB SDK in Laravel 5

image

pdffiller/laravel-influx-provider

Service provider to set up and use InfluxDB SDK in Laravel 5

  • Saturday, July 7, 2018
  • by pdffiller
  • Repository
  • 15 Watchers
  • 8 Stars
  • 2,544 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 14 Versions
  • 11 % Grown

The README.md

Laravel InfluxDB provider

A minimal service provider to set up and use InfluxDB SDK in Laravel 5, (*1)

Installation

  • Add a line to the require section of composer.json and execute $ composer install
"require": {
//  ...
    "pdffiller/laravel-influx-provider": "^1.6"
}
  • Add these lines to config/app.php
'providers' => [
//  ...
    Pdffiller\LaravelInfluxProvider\InfluxDBServiceProvider::class,
]


'aliases' => [
// ...
    'Influx' => Pdffiller\LaravelInfluxProvider\InfluxDBFacade::class,
]

  • Define env variables to connect to InfluxDB
LARAVEL_INFLUX_PROVIDER_PROTOCOL=http
LARAVEL_INFLUX_PROVIDER_USER=some_user
LARAVEL_INFLUX_PROVIDER_PASSWORD=some_password
LARAVEL_INFLUX_PROVIDER_HOST=host
LARAVEL_INFLUX_PROVIDER_PORT=8086
LARAVEL_INFLUX_PROVIDER_DATABASE=database_name
LARAVEL_INFLUX_PROVIDER_VERIFY_SSL=false
LARAVEL_INFLUX_PROVIDER_TIMEOUT=0
LARAVEL_INFLUX_PROVIDER_CONNECT_TIMEOUT=0

How to use

$client = new \Influx;
$data   = $client::query('SELECT * from "data" ORDER BY time DESC LIMIT 1');
$point = [
    new \InfluxDB\Point(
        'name' => 'some_name',
        'value' => 1, // some value for some_name
        'tags' => [
            // array of string values
        ],
        'fields' => [
            // array of numeric values
        ],
        'timestamp' => exec('date +%s%N')  // timestamp in nanoseconds on Linux ONLY
    )
];
try {
    Influx::writePoints($point);
} catch (\InfluxDB\Exception $e) {
    // something is wrong, track this
}

Also you can send data to another database like this:, (*2)

Influx::selectDB($dbName)->writePoints($point);

License

airSlate and any contributors to this project each grants you a license, under its respective copyrights, to the Laravel InfluxDB provider and other content in this repository under the MIT License, see the LICENSE file for more information.
, (*3)

The Versions

07/07 2018

dev-master

9999999-dev

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

07/07 2018

v1.6.1

1.6.1.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

17/01 2018

v1.6.0

1.6.0.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

13/06 2017

v1.5.0

1.5.0.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

18/11 2016

1.4

1.4.0.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

24/10 2016

1.3

1.3.0.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

13/09 2016

1.2.1

1.2.1.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

09/09 2016

1.2

1.2.0.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

22/06 2016

1.1.1

1.1.1.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

21/06 2016

1.1

1.1.0.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

11/05 2016

1.0.3

1.0.3.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

11/05 2016

1.0.2

1.0.2.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

06/05 2016

1.0.1

1.0.1.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db

05/05 2016

1.0.0

1.0.0.0

Service provider to set up and use InfluxDB SDK in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Balandin

laravel influx-db