arielmejiadev / larapex-charts
Package to provide easy api to build apex charts on Laravel
9.0.1
2026-01-27 01:07 UTC
Requires
- php: ^8.0|^8.2|^8.3|^8.4|^8.5
- ext-json: *
- illuminate/support: ^9.0|^10.0|^11.0|^12.0
Requires (Dev)
- nunomaduro/collision: ^7.5|^8.1
- orchestra/testbench: ^7.0|^8.0|^9.0|^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpunit/phpunit: ^9.0|^10.0|^11.0
- dev-master
- 9.0.1
- 9.0.0
- 8.1.0
- 8.0.1
- 8.0.0
- 7.0.0
- 6.0.0
- 5.2.0
- 5.1.0
- 5.0.0
- 4.1.0
- 4.0.0
- 3.0.1
- 3.0.0
- 2.1.1
- 2.1.0
- 2.0.0
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-fix/multiple-charts-in-same-view
- dev-laravel-13-upgrade
- dev-feature/states
- dev-fix/running-test-workflow
- dev-fix/upgrade-issues
- dev-grid-syntax-issue
- dev-issue-40
- dev-Development
This package is auto-updated.
Last update: 2026-03-21 08:28:21 UTC
README
A Laravel wrapper for apex charts library Check the documentation on: Larapex Chart Docs.
Installation
Use composer.
composer require arielmejiadev/larapex-charts
Usage
Basic example
In your controller add:
$chart = (new LarapexChart)->setTitle('Posts') ->setDataset([150, 120]) ->setLabels(['Published', 'No Published']);
Remember to import the Facade to your controller with
use ArielMejiaDev\LarapexCharts\Facades\LarapexChart;
Or importing the LarapexChart class:
use ArielMejiaDev\LarapexCharts\LarapexChart;
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 = (new LarapexChart)->setType('area') ->setTitle('Total Users Monthly') ->setSubtitle('From January to March') ->setXAxis([ 'Jan', 'Feb', 'Mar' ]) ->setDataset([ [ 'name' => 'Active Users', 'data' => [250, 700, 1200] ] ]);
You can create a variety of charts including: Line, Area, Bar, Horizontal Bar, Heatmap, pie, donut and Radialbar.
More examples
Check the documentation on: Larapex Chart Docs
Contributing
The author Ariel Mejia Dev.
License
Support the project
Hey 👋 thanks for considering making a donation, with these donations I can continue working to contribute to opensource projects.
Roadmap for future versions
- Add blade directive
@apexchartscdn - Add blade directive
@script($chart) - Add a chain options setter for charts
- Update Github Actions to run tests
- Update the package in general for more efficient & modern practices (spatie skeleton package)
- 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