khill/lavacharts
Lavacharts is a Laravel wrapper for Google Charts that lets you build interactive charts with a fluent PHP API. Define data tables, render charts and dashboards, and add controls or events without writing JavaScript.
Architecture fit: Lavacharts is a thin PHP-to-JS translation layer. Chart configuration is built in PHP, serialized into inline JavaScript, and paired with a <div> that loads gstatic.com/charts/loader.js at runtime. Rendering is entirely client-side; the server never rasterizes. This fits a Laravel MVC application that serves HTML dashboards from Blade views and already has data shaped by Eloquent/query builders. It is a poor fit for server-side PDF/email reports, non-browser consumers, or headless/API-only backends. The package is stateless—no persistence, queues, or workers—which keeps reasoning and testing simple. Release 3.1.14 changes nothing here; it is a packaging fix, not an architectural one.
Integration feasibility: Composer-installable with a service provider and facade (auto-discovery per the 3.x line). A single chart is roughly a dozen lines: build config, call render(), echo unescaped in Blade. Low ceremony, but the package introduces a hard frontend dependency (Google Charts CDN), which pulls CSP, asset-loading, and third-party policy into the integration. The 3.1.14 changelog ("fix the composer 2 blocker of the RenderableTrait issue #322") is directly relevant to installability: Composer 1 is EOL, so a Composer 2 install blocker on the trait would have failed at dependency resolution or autoload time and forced a fork on day one. That specific obstacle is now removed, which meaningfully improves the "install and see" path.
Technical risk:
NOASSERTION. Project history suggests MIT, but this must be confirmed by legal before commercial use—treat as a blocker. 3.1.14 does not clarify licensing.google.visualization API; no offline or self-hosted rasterization. Data-residency/GDPR review needed for regulated contexts.</script>, dates, nulls). A trait-level Composer fix implies no change to escaping behavior.Key questions:
gstatic.com acceptable under our CSP and third-party policy?Stack fit: Strong for a Laravel app serving HTML dashboards to authenticated users. Blade + service provider + facade is idiomatic; the natural flow is query → aggregate → config → render(). Weak fit for SPA frontends (call Google Charts directly in JS) or server-rendered report pipelines.
Migration path: Inbound is composer require khill/lavacharts pinned at ^3.1.14 (or later) so the RenderableTrait/Composer 2 fix is guaranteed present—pinning earlier 3.1.x reintroduces a known install blocker. Publish config, verify facade registration, drop a chart into a partial. Confirm Composer resolves against current php and laravel/framework constraints before committing—a Composer 2 resolution fix does not imply PHP 8/Laravel 10+ runtime support; expect to need a fork or constraint bump. Outbound hedge: wrap chart creation behind an internal interface (ChartRenderer) so views depend on our contract, not Lavacharts classes. This keeps a later swap to Chart.js/ApexCharts wrappers or server-side rendering (QuickChart, Browsershot) contained rather than a rewrite.
Compatibility:
composer.json requirements on the 3.x branch; 3.x targets PHP 7.x-era versions. PHP 8.2/8.3 support is unlikely to be declared—test runtime behavior, not just install.composer update on Composer 2.x only, since Composer 1 is not a supported baseline.loader.js is a hard external dependency; account for CSP script-src allowlisting and any connect-src needs.Date objects, not strings; plan a normalization layer.Sequencing:
^3.1.14, and add contract tests on rendered output.Maintenance: Still effectively low-activity upstream; 3.1.14 is a single targeted patch, not the start of a release cadence. Plan to fork and maintain: PHP 8 compatibility shims, dependency bumps, and Google Charts API drift. Assign a small owner and pin/vendor the fork. There is no security release cadence to rely on—you inherit vulnerability triage. The upside is modest but real: the maintainer merged at least one modern-toolchain blocker, so a narrowly scoped upstream fix may be obtainable rather than forked outright.
Support: Community-only (GitHub issues + docs), no commercial support. The package's own docs are thin on the broad Google Charts option surface; Google's docs become the real reference. One-line changelogs with no migration notes or support matrix mean release interpretation is on us. Internal examples and onboarding docs are necessary to concentrate knowledge.
Scaling: Server cost is negligible (config serialization only). Pressure moves to the browser and network: large datasets inflate HTML payload and JS parse/draw time, and multiple charts per page multiply loader/draw cost. Mitigate with server-side aggregation/row limits, lazy-loading on tabs/scroll, JSON endpoints drawn client-side, and partial caching. No horizontal-scaling concerns beyond the normal web tier.
Failure modes:
gstatic.com → intermittent blank charts in some environments.</script>, dates, nulls.Ramp-up: Low-to-moderate. A PHP developer can ship a first chart in under an hour; fluency in Google Charts options, formatters, and date handling takes days. Frontend/devops must understand the CSP and CDN dependency. Budget a half-day enablement plus an internal example library. The real cost is not the package API—it is Google Charts semantics and fork-maintenance ownership.
Overall: Viable for internal dashboards in a legacy-tolerant Laravel app if the license clears and PHP/Laravel compatibility is proven. Release 3.1.14 removes a concrete Composer 2 install blocker and shows upstream is not entirely abandoned, which lowers first-day integration risk and slightly improves the maintenance outlook—but it does not address the license gap, PHP 8/Laravel 9+ support, the CDN dependency, or the absence of a release cadence. Treat it as a build-and-own dependency rather than a maintained drop-in, confirm which major line is actually supported, and isolate it behind an abstraction before it becomes load-bearing.
How can I help you explore Laravel packages today?