PHPackages                             ge-tracker/influxdb-laravel - 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. ge-tracker/influxdb-laravel

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

ge-tracker/influxdb-laravel
===========================

Provide InfluxDB connections to Laravel

v3.2.1(9mo ago)16.3k1MITPHPPHP ^8.0

Since Oct 21Pushed 9mo agoCompare

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

READMEChangelog (1)Dependencies (6)Versions (13)Used By (0)

InfluxDB Laravel
================

[](#influxdb-laravel)

This package is a Laravel wrapper for the [influxdb-php](https://packagist.org/packages/influxdb/influxdb-php) client. We utilise [graham-campbell/manager](https://packagist.org/packages/graham-campbell/manager) to provide multiple connection interfaces.

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

[](#installation)

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:

    ```
    $ composer require ge-tracker/influxdb-laravel
    ```

    Laravel will auto-discover the package's service provider, located at `GeTracker\InfluxDBLaravel\InfluxDBLaravelServiceProvider`.
2. Next, you should publish the application's configuration file

    ```
    $ php artisan vendor:publish
    ```

### InfluxDB 1.x

[](#influxdb-1x)

To install a 1.7x compatible version, please install version 1.x of this package. You can [view the 1.x configuration options on GitHub](https://github.com/ge-tracker/influxdb-laravel/tree/v1).

```
$ composer require "ge-tracker/influxdb-laravel:^1.0"
```

Configuration
-------------

[](#configuration)

This package's configuration, after publishing, will be located at `config/influxdb.php`.

**Default Connection Name**

This option (`'default'`) is where you may specify which of the connections below you wish to use as your default connection for all work. Of course, you may use many connections at once using the manager class. The default value for this setting is `'main'`.

**InfluxDB Connections**

This option (`'connections'`) is where each of the connections are setup for your application. An example configuration has been included, but you may add as many connections as you would like.

Usage
-----

[](#usage)

The underlying InfluxDB connection instance can be accessed via Facade or Dependency Injection. Unless specified, the package will use the `main` connection by default.

**Facade**

```
