chartello/
chartello
g4t.io

Visualize Laravel App Data with Chartello

17 views 180 stars by Paul Redmond

Visualize your Laravel app data in simple dashboards.

README from chartello/chartello Open on GitHub →

Chartello

tests GitHub license

Chartello provides a simple UI for visualizing your data in your Laravel 10+ apps that use MySQL.

Installation

Add the package to your project via composer:

composer require chartello/chartello

Publish the package resources:

php artisan chartello:install

Run new migrations:

php artisan migrate

Voilà! Open yourapp.test/chartello on your local machine. You should see the Chartello dashboard.

Configuration

Dashboard Authorization

Chartello dashboards allow users to write SQL queries against your database. This makes it important for you to ensure that they are protected behind appropriate permissions.

When you install Chartello, it adds a app\Http\Middleware\ProtectChartello middleware to your app. This, by default, limits the access to these dashboards only to your local environment. You should modify this middleware to define how access to these dashboards should be restricted in your production environment.

/**
 * Define the authorization logic for accessing Chartello.
 *
 * @param $request
 * @return bool
 */
protected function authorize($request)
{
    if (App::environment('local')) {
        return true;
    }

    return $request->user() && in_array($request->user()->email, [
        //
    ]);
}

Dashboard Routes

After installing Chartello, its configuration file will be located at config/chartello.php. This file allows you to customize the path to the Chartello dashboards and adjust HTTP middleware that should be used when serving them.

Usage

Writing Queries

Chartello currently supports two types of panels:

1. Trend Charts

A trend chart expects an x column with date/datetime values and a numeric y column.

To populate a trend chart, create a new panel in the UI and enter a query similar to this one:

SELECT DATE(created_at) AS x, COUNT(*) AS y
FROM users
WHERE created_at BETWEEN @start AND @end
GROUP BY x
ORDER BY x ASC

Including the BETWEEN @start AND @end filter ensures that your chart reflects the date range selection available in the UI.

2. Tables

Tables are flexible and accept almost any SELECT queries.

If you wish the data in your table to reflect the date selection from the UI, you should include the BETWEEN @start AND @end filter in your query.

Here is an example query for populating a table panel:

SELECT name, email, created_at
FROM users
WHERE created_at BETWEEN @start AND @end
ORDER BY created_at DESC
LIMIT 5

Upgrading

When upgrading to a new version of Chartello, you should re-publish its assets:

php artisan vendor:publish --tag=chartello-assets --force

Upgrading from v0.5.x

Chartello no longer depends on Inertia.js. If you have published the Chartello config file, remove the HandleInertiaRequests middleware from config/chartello.php:

 'middleware' => [
     'web',
     App\Http\Middleware\ProtectChartello::class,
-    Chartello\Http\Middleware\HandleInertiaRequests::class,
 ],

License

The MIT License (MIT). Please see License File for more information.

More from the ecosystem

durable-workflow/
workflow
g4t.io
9 1,292

Durable Workflow: Long-Running Workflows for Laravel

Embedded durable workflow runtime and orchestration engine for Laravel applications.

durable-workflow/workflow via Laravel News
packstub/
session-replay
g4t.io
14 52

Session Replay for Laravel: Self-Hosted Browser Recordings

Session replay for Laravel: record what a person did in the browser with rrweb, keep the recording on your own disk and database, and watch it behind a gate you define — masked inputs by default, errors, failed Livewire requests and web vitals marked on the timeline, a link to the replay in every log line. packstub/filament-session-replay adds the sessions to a Filament panel.

packstub/session-replay via Laravel News
cyberwizard-dev/
schedule-catchup
g4t.io
17

Replay Missed Laravel Scheduled Tasks With Schedule Catchup

Schedule Catchup replays missed Laravel scheduled tasks after downtime, with opt-in recovery, bounded retries, and access to the original scheduled date.

cyberwizard-dev/schedule-catchup via Laravel News