finds.dev← search

// the find

LaravelDaily/laravel-charts

★ 553 · PHP · MIT · updated Oct 2023

Package to draw charts in Laravel with Chart.js

A Laravel package that generates Chart.js charts from Eloquent models via PHP config arrays, no JavaScript required from the developer. You define what to group by, pass a LaravelChart object to the view, and call three Blade methods. Aimed at Laravel developers who want quick admin-dashboard charts without touching JS.

The config-driven API covers the common cases well — group by date/string/relationship, sum/avg/count aggregates, date filters, and multi-dataset charts on a single canvas. The `continuous_time` option filling in empty date gaps is a small detail that saves real debugging time. Support for soft deletes and global scope removal shows it was tested against real-world Eloquent patterns. Multiple datasets on one chart (from v0.1.27) handles the dashboard scenario where you want to overlay two models' data.

Pinned to Chart.js 2.5.0 via a hardcoded cdnjs URL — that's a five-year-old version, and the current Chart.js is v4. Any Chart.js 3+ feature or API change is simply unavailable. Last pushed in October 2023 and hasn't been touched since, so this mismatch isn't going to fix itself. The option array grows to 30+ loosely-typed string keys with no validation — pass `'chart_type' => 'donut'` and nothing stops you; you'll just get a silent failure. The `conditions` option (multiple colored datasets) only works on line charts, not bar or pie, and that limitation is buried in a parenthetical. Custom queries beyond what the three report types cover require you to abandon the package entirely — there's no way to pass raw data.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →