PHPackages                             weble/laravel-databox - 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. [API Development](/categories/api)
4. /
5. weble/laravel-databox

ActiveLibrary[API Development](/categories/api)

weble/laravel-databox
=====================

Databox API integration for Laravel

01471[3 PRs](https://github.com/Weble/laravel-databox/pulls)PHP

Since May 29Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (4)Used By (0)

Databox integration for Laravel
===============================

[](#databox-integration-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d18ed080bba4fc98c7d920475b070db8a4f7b54a7e05713363e82e6849c144f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7765626c652f6c61726176656c2d64617461626f782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/weble/laravel-databox)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6e1afeb2f3388485cab6aa9de21e4cd4c1d756765198e4ae2fb7585883397c5b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7765626c652f6c61726176656c2d64617461626f782f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/weble/laravel-databox/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/703fe817238bf848517c8429658c43c128cf3e758958ace3ee30138d5d1e03d8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7765626c652f6c61726176656c2d64617461626f782f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d636f64652532307374796c65)](https://github.com/weble/laravel-databox/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/216c4cc4a9cb12ec954427b369ec76426990c87bf45d57aa4549df81cf77a380/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7765626c652f6c61726176656c2d64617461626f782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/weble/laravel-databox)

Databox integration for Laravel, with support for **sending metrics** and retrieving lists of availble metrics.

The data gets send in a **single push request after the Laravel application has finished sending the response** to avoid impacting the users. Pushing data can also be moved to the **queue** via a simple option in the config file

Example Usage
-------------

[](#example-usage)

```
use \LaravelDataBox\Facades\DataBox;

// gets the default source
$source = DataBox::source();

// Push a new metric
$source->push(new Metric(
    key: 'sales',
    value: 888.22,
));
```

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

[](#installation)

You can install the package via composer:

```
composer require weble/laravel-databox
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-databox-config"
```

This is the contents of the published config file, with each option commented:

```
