PHPackages                             tray-labs/laravel-influxdb - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. tray-labs/laravel-influxdb

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

tray-labs/laravel-influxdb
==========================

A service made to provide, set up and use the library from influxdata influxphp in Laravel.

1.0.13(2mo ago)72164.7k↓25.6%32[1 issues](https://github.com/tray-labs/laravel-influxdb/issues)MITPHP

Since Jun 13Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/tray-labs/laravel-influxdb)[ Packagist](https://packagist.org/packages/tray-labs/laravel-influxdb)[ RSS](/packages/tray-labs-laravel-influxdb/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (15)Used By (0)

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

[](#laravel-influxdb)

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

Installing
----------

[](#installing)

- Install by composer command:

```
composer require tray-labs/laravel-influxdb
```

- Or add this line to require section of `composer.json` and execute on your terminal `$ composer install`

```
"require": {
    "tray-labs/laravel-influxdb": "^1.0"
}
```

Register service provider(pick one of two).
-------------------------------------------

[](#register-service-providerpick-one-of-two)

- `Laravel`: in `config/app.php` file, `Laravel 5.5+ supports package discovery automatically, you should skip this step````
    'providers' => [
    //  ...
    TrayLabs\InfluxDB\Providers\ServiceProvider::class,
    ]
    ```

    ```
    'aliases' => [
    //  ...
        'InfluxDB' => TrayLabs\InfluxDB\Facades\InfluxDB::class,
    ]
    ```
- `Lumen`: in `bootstrap/app.php` file ```
    // config
    $app->configure('InfluxDB');

    $app->register(TrayLabs\InfluxDB\Providers\LumenServiceProvider::class);
    $app->alias('InfluxDB', TrayLabs\InfluxDB\Facades\InfluxDB::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
INFLUXDB_UDP_ENABLED=false # Activate UDP
INFLUXDB_UDP_PORT=4444 # Port for UDP
```

- Write this into your terminal inside your project
    - `Laravel````
        php artisan vendor:publish
        ```
    - `Lumen````
        cp vendor/TrayLabs/lumen-influxdb/config/InfluxDB.php config/InfluxDB.php
        ```

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

[](#reading-data)

```
