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.

v2.0.0(1mo ago)73171.7k↓57.1%31MITPHP

Since Jun 13Pushed 1mo 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 3d ago

READMEChangelog (10)Dependencies (8)Versions (17)Used By (0)

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

[](#laravel-influxdb)

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

Installing
----------

[](#installing)

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

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

[](#register-service-provider-pick-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 ```
    $app->configure('InfluxDB');
    $app->register(TrayLabs\InfluxDB\Providers\LumenServiceProvider::class);
    $app->alias('InfluxDB', TrayLabs\InfluxDB\Facades\InfluxDB::class);
    ```

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

[](#configuration)

Define the env variables to connect to InfluxDB:

```
INFLUXDB_HOST=localhost
INFLUXDB_PORT=8086
INFLUXDB_TOKEN=my-token
INFLUXDB_ORG=my-org
INFLUXDB_BUCKET=my-bucket
INFLUXDB_SSL=false
INFLUXDB_VERIFYSSL=false
INFLUXDB_TIMEOUT=0
```

Publish the config file:

```
php artisan vendor:publish
```

Writing Data
------------

[](#writing-data)

```
use InfluxDB2\Point;

$writeApi = InfluxDB::createWriteApi();

$point = Point::measurement('test_metric')
    ->addTag('host', 'server01')
    ->addTag('region', 'us-west')
    ->addField('cpucount', 10)
    ->time(microtime(true));

$writeApi->write($point);
$writeApi->close();
```

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

[](#reading-data)

```
$queryApi = InfluxDB::createQueryApi();

$result = $queryApi->query(
    'from(bucket:"my-bucket") |> range(start: -1h) |> filter(fn: (r) => r._measurement == "test_metric")'
);

foreach ($result as $table) {
    foreach ($table->records as $record) {
        echo $record->getField() . ': ' . $record->getValue() . PHP_EOL;
    }
}
```

License
-------

[](#license)

This project is licensed under the MIT License

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance90

Actively maintained with recent releases

Popularity48

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~232 days

Recently: every ~298 days

Total

15

Last Release

53d ago

Major Versions

1.0.13 → v2.0.02026-05-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29306337?v=4)[Traylabs - José Henrique Honjoya](/maintainers/tray-labs)[@tray-labs](https://github.com/tray-labs)

---

Top Contributors

[![dsandrade](https://avatars.githubusercontent.com/u/26100880?v=4)](https://github.com/dsandrade "dsandrade (18 commits)")[![tray-labs](https://avatars.githubusercontent.com/u/29306337?v=4)](https://github.com/tray-labs "tray-labs (15 commits)")[![1giba](https://avatars.githubusercontent.com/u/4941544?v=4)](https://github.com/1giba "1giba (7 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (4 commits)")[![honjoya](https://avatars.githubusercontent.com/u/688954?v=4)](https://github.com/honjoya "honjoya (2 commits)")[![KuenzelIT](https://avatars.githubusercontent.com/u/4572444?v=4)](https://github.com/KuenzelIT "KuenzelIT (2 commits)")[![tobias-kuendig](https://avatars.githubusercontent.com/u/8600029?v=4)](https://github.com/tobias-kuendig "tobias-kuendig (2 commits)")[![swilla](https://avatars.githubusercontent.com/u/304159?v=4)](https://github.com/swilla "swilla (1 commits)")[![edbizarro](https://avatars.githubusercontent.com/u/84926?v=4)](https://github.com/edbizarro "edbizarro (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tray-labs-laravel-influxdb/health.svg)

```
[![Health](https://phpackages.com/badges/tray-labs-laravel-influxdb/health.svg)](https://phpackages.com/packages/tray-labs-laravel-influxdb)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[illuminate/log

The Illuminate Log package.

6225.3M623](/packages/illuminate-log)[spatie/laravel-flare

Send Laravel errors to Flare

111.4M7](/packages/spatie-laravel-flare)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
