Skip to content

Configuration

After running php artisan livecharts:install, you’ll find config/livecharts.php in your app. The most common knobs are documented here. For the full reference, see the Configuration File page.

VariableDefaultPurpose
LIVECHARTS_DEFAULT_ENGINEapexchartsEngine used when a chart does not call engine().
LIVECHARTS_ASSETS_MODEbothHow @liveChartsScripts resolves engine assets.
LIVECHARTS_THEMEautoDefault theme resolution: auto, light, dark.
ModeBehaviour
localServe only the bundles published under public/vendor/livecharts.
cdnServe only the public CDN URLs.
bothServe local first, fall back to CDN via the <script> onerror handler.

both is the default — and recommended for production. It keeps charts working even when the local copy hasn’t been re-published after a deployment.

Switch the global default without touching every chart:

config/livecharts.php
return [
'default_engine' => env('LIVECHARTS_DEFAULT_ENGINE', 'chartjs'),
// ...
];

Per-chart override stays available:

LiveCharts::bar()->engine('apexcharts');

Each engine is registered with its adapter, the local asset path, and the CDN URL:

'engines' => [
'apexcharts' => [
'adapter' => Matheusmarnt\LiveCharts\Engines\ApexChartsAdapter::class,
'assets' => [
'local' => '/vendor/livecharts/apexcharts.js',
'cdn' => 'https://cdn.jsdelivr.net/npm/apexcharts@5.10.6/dist/apexcharts.min.js',
],
],
// ...
],

You can register additional engines at runtime — see Custom Engines.