- How do I install chart-js-integration in Laravel Nova?
- Run composer require coroowicaksono/chart-js-integration, then add the card to a dashboard definition inside NovaServiceProvider::dashboards() using the fluent API for type, series, options and height. There are no migrations, published config files, queue workers or external services involved. A working chart card is roughly a half-day spike for a mid-level Laravel developer.
- Does this package work without Laravel Nova?
- No. It extends Laravel\Nova\Card and ships a pre-compiled Vue component that Nova mounts on a dashboard or resource page, so it is unusable outside a Nova installation. The real architectural decision is therefore whether you run Nova, not whether you want charts. For a plain Laravel app, use a general Chart.js or charting package instead.
- Which chart types does this Nova Chart.js package support?
- It covers the common admin set: bar, stacked bar, line, area, doughnut and pie charts. Each chart is registered as a Nova card, so it inherits Nova's layout, routing, auth middleware and theme. It is a presentation layer only, meaning aggregation, scoping and caching of the underlying data remain your responsibility on the PHP side.
- Is this package compatible with Laravel Nova 5?
- There is no official compatibility statement. The v0.4.3 release notes contain no Nova-version claim, so Nova 5 support is unverified. Because Nova is commercial and closed-source, you cannot patch the underlying framework, only the card. Verify against a staging Nova instance before committing, and treat a major Nova upgrade as a potential rewrite trigger.
- How do I pass Eloquent query results to a chart card?
- You can pass literal arrays or data derived from Eloquent and DB queries directly when constructing the card in your dashboard's cards() method. Every dashboard load executes those queries synchronously, so N chart cards means N data fetches per page view; cache or precompute aggregates where possible. Normalize payloads to plain arrays rather than stdClass rows.
- Are Nova resource policies applied to chart data automatically?
- No. Nova resource policies are not automatically applied to hand-written chart queries, so the card renders whatever rows the query returns. Multi-tenant or role-scoped dashboards are the highest-severity failure mode here. Scope every chart query explicitly by tenant, role or permission in your own layer rather than assuming Nova will filter it.
- Why am I getting a must be of type Countable, stdClass given error?
- Before v0.4.3, passing a stdClass such as an aggregate row from DB::table()->first() or decoded JSON config into the series or options payload raised a PHP type error; v0.4.3 tolerates it. The underlying signal is that the payload contract is loose and not strictly documented. The correct fix is on your side: cast payloads to arrays with (array) or toArray() in your own chart definition layer instead of relying on the package's coercion.
- How do I use custom Chart.js options or JS callbacks like tooltip formatters?
- Options that require JavaScript callbacks, such as tooltip or label formatters, cannot be serialized cleanly from PHP and typically require a custom Vue component. Chart.js is bundled into the card's compiled assets, so a second card or script loading a different Chart.js build can collide. Strict Content Security Policies may also block the inline config payload, so test under your production CSP.
- How should I test a Nova dashboard built with these chart cards?
- There is no evidence of an upstream CI matrix or Nova-version test coverage, so test your own dashboard definitions. Assert that each card is present and configured with the expected payload in your Nova dashboard tests, and verify the rendered charts in a staging Nova instance or with browser tests. Pin the exact package version, since pre-1.0 minor bumps may carry breaking changes.
- Is this package maintained and safe to use in production?
- It is pre-1.0 (0.4.3), single-maintainer and has few dependents; the v0.4.3 release is a one-line bug fix, which suggests the maintainer is not fully absent but is not evidence of a support process or SLA. Assume no upstream support commitment and pin the exact version in composer.json. If you need richer chart types, non-Nova rendering or active maintenance, prefer a general Chart.js integration or a better-supported Laravel charting package.