gigerit / larapex-charts
Package to provide easy api to build apex charts on Laravel
Requires
- php: ^8.3
- ext-json: *
- illuminate/support: ^12.0|^13.0
Requires (Dev)
- driftingly/rector-laravel: ^2.3
- laravel/pint: ^1.29
- orchestra/testbench: ^10.0|^11.1
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5.50|^12.5.8|^13.0.3
- rector/rector: ^2.4
Suggests
None
Provides
None
Conflicts
None
Replaces
- arielmejiadev/larapex-charts: v10.2.1
This package is auto-updated.
Last update: 2026-11-07 21:13:30 UTC
README
Larapex Charts is a Laravel wrapper for the ApexCharts JavaScript charting library.
This package is the gigerIT-maintained fork of
arielmejiadev/larapex-charts. It continues the original package with ongoing
maintenance, compatibility updates, code cleanups, optimizations, and support
for current Laravel versions, including Laravel 13.
It is a drop-in replacement for the original package. Existing applications do not need code changes, namespace changes, config changes, or view changes. The public API, service provider, facade, publishable assets, and generated chart stubs remain compatible with the original package.
Check the upstream documentation on: Larapex Chart Docs.
About this fork
This fork keeps Larapex Charts usable in modern Laravel applications while preserving the original developer experience. The goal is to provide a reliable maintenance path for projects that already depend on Larapex Charts and for new projects that want the same simple chart-building API.
Maintained improvements include:
- Laravel 12 and 13 compatibility.
- Composer metadata updates so the package can be installed as
gigerit/larapex-chartsfrom Packagist. - CI coverage for PHPUnit, PHPStan static analysis, and a Laravel/PHP compatibility matrix.
- Package cleanups to remove generated files, IDE metadata, logs, test reports, and other local artifacts from distributed releases.
- Repository and release hygiene improvements for cleaner installs and more predictable package archives.
- Ongoing maintenance, fixes, and optimizations while keeping the package compatible with existing usage.
Requirements
PHP 8.3 or later and Laravel 12 or 13 are required. Laravel 11 is no longer supported; upgrade your application before installing this version.
Drop-in replacement
Use this fork when you want a maintained version of Larapex Charts without rewriting existing application code.
If your application currently uses arielmejiadev/larapex-charts, replace the
Composer dependency with this fork:
composer remove arielmejiadev/larapex-charts composer require gigerit/larapex-charts
No PHP imports need to change. Continue using the existing namespace:
use ArielMejiaDev\LarapexCharts\Facades\LarapexChart;
The package also declares a Composer replacement for the original package name,
so downstream packages that require arielmejiadev/larapex-charts can be
satisfied by this fork.
Installation
Install the maintained fork with Composer:
composer require gigerit/larapex-charts
The make:chart command is registered automatically; no command publishing is
needed. Pass --vue or --json for a Vue or JSON chart class; the command
rejects both together. The obsolete larapex-charts-commands publish tag has been removed.
Use larapex-charts-stubs to publish customizable chart templates. Published
stubs are copies that Composer updates do not touch; to pick up stub fixes after
upgrading, republish them with
php artisan vendor:publish --tag=larapex-charts-stubs --force, which
overwrites your customizations.
ApexCharts version and license
$chart->cdn() returns https://cdn.jsdelivr.net/npm/apexcharts@8, which
serves the latest ApexCharts 8.x release. The local copy published with the
larapex-charts-apexcharts-script tag is ApexCharts 8.7.0; the version is in
the file header. Moving to a new ApexCharts major is a package change.
ApexCharts 5.2 and later are not MIT licensed. They are distributed under the
ApexCharts License, which is free for
organizations under $2M USD in annual revenue, budget, or funding; larger
organizations need a commercial license. Check that your use complies before
loading either file. To load a specific version instead, replace
$chart->cdn() with your own script tag, such as
https://cdn.jsdelivr.net/npm/apexcharts@4.7.0, the last MIT-licensed release.
Usage
Basic example
In your controller add:
use ArielMejiaDev\LarapexCharts\Facades\LarapexChart; $chart = LarapexChart::donutChart() ->setTitle('Posts') ->addData([150, 120]) ->setLabels(['Published', 'No Published']);
Without the facade, import ArielMejiaDev\LarapexCharts\LarapexChart and start
with (new LarapexChart)->donutChart().
Then in your view (Blade file) add:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Chart Sample</title>
</head>
<body>
{!! $chart->container() !!}
<script src="{{ $chart->cdn() }}"></script>
{{ $chart->script() }}
</body>
</html>
More complex example
$chart = LarapexChart::areaChart() ->setTitle('Total Users Monthly') ->setSubtitle('From January to March') ->setXAxis(['Jan', 'Feb', 'Mar']) ->addData([250, 700, 1200], 'Active Users') ->addData([100, 300, 650], 'New Users');
Each chart type has a factory: pieChart(), donutChart(), radialChart(),
polarAreaChart(), lineChart(), areaChart(), barChart(),
horizontalBarChart(), heatMapChart(), and radarChart(). Pie, donut,
radial, and polar area charts take one addData([...]) call plus
setLabels([...]); the others take one addData([...], 'Series name') call per
series.
Custom ApexCharts options
Use setOptions() for ApexCharts options without a dedicated setter. They merge
over the generated options of Blade, JSON, and Vue output: nested objects merge
key by key, while lists and scalar values replace the generated ones.
$chart = LarapexChart::areaChart() ->addData([250, 700, 1200], 'Active Users') ->setXAxis(['Jan', 'Feb', 'Mar']) ->setOptions([ 'tooltip' => ['enabled' => false], 'xaxis' => ['labels' => ['rotate' => -45]], ]);
Light and dark frontend themes
Every chart sends chart.foreColor from the font_color config and
theme.mode light by default. When the frontend switches between light and
dark themes, leave them unset so ApexCharts' or your app's theme colors apply:
set font_color to null in config/larapex-charts.php, or call
setFontColor(null) and setTheme(null) on a chart.
More examples
Check the documentation on: Larapex Chart Docs
Laravel Boost
This package ships a Laravel Boost skill for AI-assisted development. When an
application has both gigerit/larapex-charts and laravel/boost installed,
Boost can discover the package skill from
resources/boost/skills/larapex-charts-development/SKILL.md and install it for
supported agents during php artisan boost:install or
php artisan boost:update --discover.
Contributing
This fork is maintained by gigerIT. Contributions that improve compatibility, reliability, tests, documentation, or package hygiene are welcome.
Before submitting changes, run the test suite and static analysis:
composer test
composer test:types
The package was originally created by Ariel Mejia Dev. This fork preserves the original package API and credits while continuing maintenance for modern Laravel projects.
License
Larapex Charts is MIT licensed. The bundled
stubs/public/apexcharts.js is ApexCharts, distributed under the
ApexCharts License; see
ApexCharts version and license.
Roadmap for future versions
- Add blade directive
@apexchartscdn - Add blade directive
@script($chart) - Expand
setOptions()documentation with advanced ApexCharts examples - Continue modernizing internals while preserving the drop-in API
- Add ReactJS + Inertia Support
- Add More complex charts
- Add More complex boilerplate code using Laravel/Prompts
- Add more complex boilerplate code examples using Laravel Trends Package