PHPackages                             power-data-hub/laraflux - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. power-data-hub/laraflux

ActiveLibrary[Database &amp; ORM](/categories/database)

power-data-hub/laraflux
=======================

A service made to provide, set up and use influxphp in Laravel.

v0.0.1(7y ago)223[1 PRs](https://github.com/PowerDataHub/laraflux/pulls)MITPHPPHP ^7.1.3CI passing

Since May 20Pushed 5y agoCompare

[ Source](https://github.com/PowerDataHub/laraflux)[ Packagist](https://packagist.org/packages/power-data-hub/laraflux)[ RSS](/packages/power-data-hub-laraflux/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

[![Maintained by Powerdatahub.com](https://camo.githubusercontent.com/02fc21078c3a5a032831a9f67ba7d187249f9bdf5d2befca46adea2c1c1b7fe9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e7461696e656425323062792d706f776572646174616875622e636f6d2d2532333344344446452e7376673f7374796c653d666f722d7468652d6261646765)](https://powerdatahub.com/?ref=laraflux)

Laravel Influxdb
================

[](#laravel-influxdb)

A service made to provide, set up and use [influxdb-php](https://github.com/influxdata/influxdb-php/) in Laravel 5.6

Installation
------------

[](#installation)

Follow this steps to use this package on your Laravel installation

### 1. Require it on composer

[](#1-require-it-on-composer)

```
composer require power-data-hub/laraflux
```

The package will automatically register it's service provider.

For Laravel &lt;= 5.4 add the provider manually

### 2. Load service provider (optional Laravel &lt;= 5.4 only)

[](#2-load-service-provider-optional-laravel--54-only)

You need to update your `config/app.php` configuration file to register our service provider, adding this line on `providers` array:

```
PowerDataHub\Laraflux\ServiceProvider::class
```

```
'aliases' => [
//  ...
    'Laraflux' => PowerDataHub\Laraflux\Facades\Laraflux::class,
]

```

- Define `.env` variables to connect to InfluxDB

```
INFLUXDB_HOST=localhost
INFLUXDB_PORT=8086
INFLUXDB_USER=some_user
INFLUXDB_PASSWORD=some_password
INFLUXDB_SSL=false
INFLUXDB_VERIFYSSL=false
INFLUXDB_TIMEOUT=0
INFLUXDB_DBNAME=some_database
```

- Write this into your terminal inside your project

```
php artisan vendor:publish
```

Reading Data
------------

[](#reading-data)

```
