PHPackages                             calvient/arbol - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. calvient/arbol

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

calvient/arbol
==============

A simple data visualization tool for Laravel apps.

0.5.7(1mo ago)09.8k↓28.9%[3 PRs](https://github.com/calvient/arbol/pulls)MITPHPPHP ^8.3CI failing

Since May 23Pushed 1mo agoCompare

[ Source](https://github.com/calvient/arbol)[ Packagist](https://packagist.org/packages/calvient/arbol)[ Docs](https://github.com/calvient/arbol)[ RSS](/packages/calvient-arbol/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (28)Versions (59)Used By (0)

Arbol - A Simple Data Visualization Tool for Laravel Apps
=========================================================

[](#arbol---a-simple-data-visualization-tool-for-laravel-apps)

[![Latest Version on Packagist](https://camo.githubusercontent.com/75eb889cb5f3a616a438c9f31df37d0f3b063bdd2138872c4301aae37b5037cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63616c7669656e742f6172626f6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/calvient/arbol)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a4a67d6b6a5c98923e1bb8fde76ce2955f42200bcb409a26d6da09d7daa26354/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63616c7669656e742f6172626f6c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/calvient/arbol/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a0c6ef321cac347054de0cbecfb172a3ba9dcaa069106dfcd2221ae7297180bc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63616c7669656e742f6172626f6c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/calvient/arbol/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/3407547d37c98a70c8ce933cb96758921589fe0e7c3ca2b99a3f7270ced7c49f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616c7669656e742f6172626f6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/calvient/arbol)

Arbol is a simple data visualization tool for Laravel applications built with Inertia.js and React.

It allows users to create their own reports, extracts, and simple dashboards with support for tables, line charts, bar charts, and pie charts.

This is a simple tool that solves 80% of a complex problem! So you may still want a paid data visualization tool. But if you need something simple, this might just be for you.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 10, 11, or 12
- Inertia.js with React

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

[](#installation)

You can install the package via composer:

```
composer require calvient/arbol
```

Publish all the assets with:

```
php artisan vendor:publish --provider="Calvient\Arbol\ArbolServiceProvider"
```

Run migrations with:

```
php artisan migrate
```

Quick Start
-----------

[](#quick-start)

### 1. Install the package

[](#1-install-the-package)

```
composer require calvient/arbol
```

### 2. Publish the package assets and run migrations

[](#2-publish-the-package-assets-and-run-migrations)

```
php artisan vendor:publish --provider='Calvient\Arbol\ArbolServiceProvider'
php artisan migrate
```

### 3. Publish the package assets after each update

[](#3-publish-the-package-assets-after-each-update)

Add the following to `composer.json` under the `scripts` -&gt; `post-update-cmd` key:

```
@php artisan vendor:publish --tag=arbol-assets --ansi --force
```

### 4. Configure the package

[](#4-configure-the-package)

We assume your User model is `App\Models\User`. If not, you can override it in the `config/arbol.php` config file:

```
return [
    'user_model' => 'App\Models\User',
    'series_path' => app_path('Arbol'),
];
```

Because Arbol can assign reports to users, you may also want to further limit which users Arbol can see. You can add a scope like the following to your User model:

```
public function scopeArbol($query)
{
    return $query->where('is_admin', true);
}
```

### 5. Create a New Series

[](#5-create-a-new-series)

```
php artisan make:arbol-series PodcastStreams
```

Core Concepts
-------------

[](#core-concepts)

Arbol works by using these 5 core concepts:

### Series

[](#series)

A series is the raw data set that a user can interact with. For example, you might have a series for "Podcast Streams" which contains data from one or more sources. The only requirement is that it must return the data as a 2-dimensional array (array of associative arrays).

### Slices

[](#slices)

A slice is a way to group data. You might want to view "Podcast Streams" by state or by month, for instance.

### Filters

[](#filters)

Filters allow users to narrow down the data based on predefined criteria. For example, a user may only care to see "Podcast Streams" for the last week or from specific sources.

### Aggregators

[](#aggregators)

Aggregators define how to summarize the data when displaying charts. Common aggregators include counting rows, summing values, or calculating averages.

### Formats

[](#formats)

Formats determine how the data is displayed:

- **Table**: Raw tabular data display
- **Pie Chart**: Distribution visualization
- **Line Chart**: Trends over time
- **Bar Chart**: Comparison visualization

Creating a Series
-----------------

[](#creating-a-series)

A series must implement the `IArbolSeries` interface:

```
