PHPackages                             mare06xa/geckoboard - 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. mare06xa/geckoboard

ActiveLibrary

mare06xa/geckoboard
===================

Geckoboard - Laravel bridge.

0291[2 PRs](https://github.com/markoKodric/geckoboard-laravel/pulls)PHP

Since Oct 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/markoKodric/geckoboard-laravel)[ Packagist](https://packagist.org/packages/mare06xa/geckoboard)[ RSS](/packages/mare06xa-geckoboard/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

**Currently supports Widgets PUSH API, Widgets POLLING API and Datasets API.**

Installation
============

[](#installation)

Require this package with [composer](http://getcomposer.org).

```
composer require mare06xa/geckoboard

```

In Laravel 5.5 and above the package will autoregister the service provider. In Laravel 5.4 you must install this service provider.

```
// config/app.php
'providers' => [
    ...
    Mare06xa\Geckoboard\GeckoboardServiceProvider::class,
    ...
];
```

In Laravel 5.5 and above the package will autoregister the facade. In Laravel 5.4 you must install the facade manually.

```
// config/app.php
'aliases' => [
    ...
    'Geckoboard' => Mare06xa\Geckoboard\GeckoboardFacade::class,
    ...
];
```

Create config file.

```
php artisan vendor:publish

```

Choose `Mare06xa\Geckoboard\GeckoboardServiceProvider` if prompted.

Configuration
=============

[](#configuration)

You will need API token from Geckoboard.

- Go to ****, sign up and confirm your account
- Go to your profile settings and copy your API token

Add this line to your `.env` configuration file

```
GECKO_TOKEN={Insert your token here}

```

Set path to Datasets configuration YAML file

```
// config/geckoboard.php
return [
    ...
    'datasets_config' => base_path('resources/configs/datasets.yaml')
    ...
];
```

---

Widgets Polling API
===================

[](#widgets-polling-api)

Basic usage
-----------

[](#basic-usage)

First setup your widget on Geckoboard.

- Method: Polling
- Data feed URL: {Your application URL with correct endpoint that returns JSON data}
- Data feed format: JSON

```
Route::get('test', function () {
    $geckoMeter = Geckoboard::pollingAPI()->geckoMeter();

    $geckoMeter->value(23)
        ->min(0)
        ->max(100);

    return $geckoMeter->toJSON();
});
```

---

Datasets API
============

[](#datasets-api)

Basic usage
-----------

[](#basic-usage-1)

```
use Mare06xa\Geckoboard\Geckoboard;

class SomeClass
{
    public function foo()
    {
        $dataset = Geckoboard::datasetAPI()->createDataset('testing.id');

        $dataset->schema()
            ->addNumber()
            ->setKey('amount')
            ->setName('Amount')
            ->addData([819, 409, 164, 180]);

        $dataset->schema()
            ->addDatetime()
            ->setKey('timestamp')
            ->setName('Date')
            ->addData(["2018-01-01T12:00:00Z", "2018-01-02T12:00:00Z", "2018-01-03T12:00:00Z"])
            ->isUnique();

        $apiResponse1 = $dataset->applySchema();
        $apiResponse2 = $dataset->appendData();
    }
}
```

Basic usage with Database
-------------------------

[](#basic-usage-with-database)

```
use Mare06xa\Geckoboard\Geckoboard;

class SomeClass
{
    public function foo()
    {
        $sqlDataset = Geckoboard::datasetAPI()
            ->withDB()
            ->createDataset('testing.id');

        $sqlDataset->schema()
           ->addNumber()
           ->setKey('amount')
           ->setName('Amount');

        $sqlDataset->schema()
           ->addNumber()
           ->setKey('amount2')
           ->setName('Amount 2');

        $sqlDataset->schema()
           ->addString()
           ->setKey('desc')
           ->setName('Description');

        // Set DB connection driver (optional)
        $sqlDataset->setDB('mysql');

        // Use dataset method for query building
        $dbData = $sqlDataset
            ->dbQuery()
            ->table('test_table')
            ->get(['col1', 'col2', 'col3']);

        // Or acquire data directly with Laravel query builder
        $dbData = DB::table('test_table')->get(['col1', 'col2', 'col3']);

        $sqlDataset->setData($dbData);

        $apiResponse1 = $sqlDataset->applySchema();
        $apiResponse2 = $sqlDataset->replaceData();
    }
}
```

Loading dataset from YAML file (applies schema to dataset)
----------------------------------------------------------

[](#loading-dataset-from-yaml-file-applies-schema-to-dataset)

**Example YAML file**

```
dataset.testid2:
    type: sql
    schema:
        amount:
            type: number
            name: Amount
        amount2:
            type: number
            name: Amount2
            optional: true
        desc:
            type: string
            name: Description
            unique: true
dataset.testid:
    type: standard
    schema:
        amount:
            type: number
            name: Amount
        timestamp:
            type: datetime
            name: Date
            unique: true
```

**Code**

```
$configPath = config('geckoboard.datasets_config');
$datasetID  = "testing.id";

$sqlDataset = Geckoboard::datasetAPI()->loadDatasetFromFile($configPath, $datasetID);

$dbData = $sqlDataset
    ->dbQuery()
    ->table('test_table')
    ->get(['col1', 'col2', 'col3']);

$sqlDataset->setData($dbData);

$apiResponse = $sqlDataset->replaceData();
```

---

Widgets Push API
================

[](#widgets-push-api)

Basic usage
-----------

[](#basic-usage-2)

```
use Mare06xa\Geckoboard\Geckoboard;

class SomeClass
{
    public function foo()
    {
        // Widget ID is obtained on Geckoboard by clicking "Edit" in the widget options...
        $widget = Geckoboard::pushAPI()->widgetClass($widgetID);

        // Optionally you can set different API Token if you are working with multiple accounts...
        $widget->setApiToken($apiToken);

        $widget->firstMethod()
            ->secondMethod();

        $apiResponse = $widget->push();
    }
}
```

Bar Chart
---------

[](#bar-chart)

```
$barChart = Geckoboard::pushAPI()->barChart($widgetID);

// ... set data

$apiResponse = $barChart->push();
```

**X axis**

```
// Standard format
$barChart->xAxis()
    ->setLabels("January", "February", "March");

// Datetime format
$barChart->xAxis()
    ->setFormat(Format::DATETIME_ISO_8601)
    ->setLabels("2019-01-01", "2019-01-02"); // Also accepts date in format "Y-m" => "2019-12"
    ->addLabel("2019-01-03")
```

**Y axis**

```
// Decimal format
$barChart->yAxis()
    ->addData($numberArray, "Data Label 1");

// Currency format
$barChart->yAxis()
    ->addData($numberArray,  "Data Label 1")
    ->addData($numberArray2, "Data Label 2")
    ->setFormat(Format::CURRENCY)
    ->setCurrency("USD");

// Percentage format
$barChart->yAxis()
    ->addData($numberArray, "Data Label 1")
    ->setFormat(Format::PERCENT);
```

Bullet Graph
------------

[](#bullet-graph)

```
$bulletGraph = Geckoboard::pushAPI()->bulletGraph($widgetID);

$bulletGraph->setOrientation(Orientation::HORIZONTAL);

$itemNo1 = new BulletGraphItem();

$itemNo1->setLabel("Revenue 2014 YTD")
    ->setAxisData([0, 200, 400, 600, 800, 1000]);

$itemNo1->range()
    ->red(0, 400)
    ->amber(401, 700)
    ->green(701, 1000);

$itemNo1->measure()
    ->current(0, 400)
    ->projected(100, 900);

$itemNo1->setComparative(600);

$bulletGraph->items()
    ->add($itemNo1);

$apiResponse = $bulletGraph->push();
```

Funnel
------

[](#funnel)

```
$funnel = Geckoboard::pushAPI()->funnel($widgetID);

$funnel->items()
    ->add(87809, "Step 1")
    ->add(70022, "Step 2")
    ->add(63232, "Step 3")
    ->add(53232, "Step 4")
    ->add(32123, "Step 5")
    ->add(23232, "Step 6")
    ->add(12232, "Step 7")
    ->add(10001, "Step 8");

$apiResponse = $funnel->push();
```

Geck-o-Meter
------------

[](#geck-o-meter)

```
$geckoMeter = Geckoboard::pushAPI()->geckoMeter($widgetID);

$geckoMeter->value(23)
    ->min(0)
    ->max(100);

$apiResponse = $geckoMeter->push();
```

Leaderboard
-----------

[](#leaderboard)

```
$leaderBoard = Geckoboard::pushAPI()->leaderBoard($widgetID);

$leaderBoard->items()->setFormat(Format::PERCENT);

for ($i = 0; $i < 25; $i++) {
    $value = $faker->randomFloat(4, 0.01, 0.09);
    $label = ucfirst($faker->word);
    $prevRank = $faker->numberBetween(0, 25);

    if ($faker->boolean(50)) {
        $leaderBoard->items()->add($value, $label);
    } else {
        $leaderBoard->items()->add($value, $label, $prevRank);
    }
}

$leaderBoard->items()   // Sort by value in descending order...
    ->sort();           // To sort in ascending order, pass argument SORT_ASC...

$apiResponse = $leaderBoard->push();
```

Line Chart
----------

[](#line-chart)

```
$lineChart = Geckoboard::pushAPI()->lineChart($widgetID);

$lineChart->xAxis()
    ->setFormat(Format::DATETIME_ISO_8601);

$lineChart->yAxis()
    ->setFormat(Format::CURRENCY)
    ->setCurrency("EUR")
    ->addLine([1, 2, 3, 4, 5], 'Profit [€]', Carbon::now()->addDay()->format('Y-m-d'))
    ->addLine([2, 3, 4, 5, 6], 'Expenses [€]', Carbon::now()->addDay()->format('Y-m-d'));

$apiResponse = $lineChart->push();
```

List
----

[](#list)

```
$list = Geckoboard::pushAPI()->list($widgetID);

$list->items()
    ->add("Chrome", "40327 visits", "New!")
    ->add("Safari", "11577 visits", "New!", "#00FF00")
    ->add("Firefox", "10295 visits")
    ->add("MS Edge", "3578 visits")
    ->add("Opera", "499 visits");

$apiResponse = $list->push();
```

Map
---

[](#map)

```
$map = Geckoboard::pushAPI()->map($widgetID);

$map->points()
    ->prepareCity("London", "GB")
    ->setSize(10)
    ->add();

$map->points()
    ->prepareCity("San Francisco", "US")
    ->add();

$map->points()
    ->prepareLatitudeLongitude("22.2670", "114.1880")
    ->setColor("#D8F709")
    ->add();

$map->points()
    ->prepareLatitudeLongitude("-33.94336", "18.896484")
    ->setSize(5)
    ->add();

$map->points()
    ->prepareHost("geckoboard.com")
    ->setColor("#77DD77")
    ->setSize(6)
    ->add();

$map->points()
    ->prepareIP("178.125.193.227")
    ->add();

$apiResponse = $map->push();
```

Monitoring
----------

[](#monitoring)

```
$monitoring = Geckoboard::pushAPI()->monitoring($widgetID);

$monitoring->status(MonitoringStatus::UP)
    ->downTime("9 days ago")
    ->msResponseTime(593);

$apiResponse = $monitoring->push();
```

Number and Secondary Stat
-------------------------

[](#number-and-secondary-stat)

```
$numberStat = Geckoboard::pushAPI()->numberSecondaryStat($widgetID);

$numberStat->items()
    ->add(700000, "", "€");

$apiResponse = $numberStat->push();
```

Pie Chart
---------

[](#pie-chart)

```
$pieChart = Geckoboard::pushAPI()->pieChart($widgetID);

$pieChart->items()
    ->add(100, "May", "#13699C")
    ->add(160, "June", "#198ACD")
    ->add(300, "July", "#60B8EC")
    ->add(140, "August", "#A4D7F4");

$apiResponse = $pieChart->push();
```

RAG
---

[](#rag)

```
$RAG = Geckoboard::pushAPI()->RAG($widgetID);

$RAG->items()
    ->first(16,  "Long past due")
    ->second(64, "Overdue")
    ->third(32,  "Due")
    ->reverse()
    ->setPrefix("€");

$apiResponse = $RAG->push();
```

Text
----

[](#text)

```
$text = Geckoboard::pushAPI()->text($widgetID);

$text->items()
    ->add("Unfortunately, as you probably already know, people")
    ->add("As you might know, I am a full time Internet", TextType::ALERT);

$apiResponse = $text->push();
```

---

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 97.9% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7dc86bd58ba2ef017d8e5c7dc47d0ddc96b67445210fba8ff213c99fe7a31c79?d=identicon)[mare06xa](/maintainers/mare06xa)

---

Top Contributors

[![markoKodric](https://avatars.githubusercontent.com/u/18535475?v=4)](https://github.com/markoKodric "markoKodric (46 commits)")[![BlazOrazem](https://avatars.githubusercontent.com/u/5699173?v=4)](https://github.com/BlazOrazem "BlazOrazem (1 commits)")

### Embed Badge

![Health badge](/badges/mare06xa-geckoboard/health.svg)

```
[![Health](https://phpackages.com/badges/mare06xa-geckoboard/health.svg)](https://phpackages.com/packages/mare06xa-geckoboard)
```

PHPackages © 2026

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