Download the PHP package nabcellent/chartisan without Composer
On this page you can find all versions of the php package nabcellent/chartisan. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nabcellent/chartisan
More information about nabcellent/chartisan
Files in nabcellent/chartisan
Package chartisan
Short Description The laravel charting package
License MIT
Homepage https://github.com/nabcellent/chartisan
Informations about the package chartisan
CHARTISAN
What is Chartisan?
Chartisan is a Laravel library used to create charts. This library attempts to provide more laravel-like features into it by providing support for chart creation using the artisan command, middleware support and routing support. This makes handling charts feel more laravel-like.
Chartisan makes creating charts a laravel experience that's quick and elegant.
Installation
You can install Chartisan by using Composer
You can use the following composer command to install it into an existing laravel project.
Laravel will already register the service provider to your application because Chartisan
does make use of the extra laravel tag on the composer.json
schema.
Publish the configuration file
You can publish the config file with:
This will create a new file under app/config/chartisan.php
that you can edit to modify the
options of Chartisan.
Create Charts
You can start creating charts with the typical make
command by laravel artisan.
Following the other make conventions, you may use the following command to create a new chart and give it a name. The name will be used by the class and also the route name. You may further change this in the created class.
This will create a SampleChart class under App\Charts
namespace that will look like this:
Create the Chartisan instance
The handler method is the one that will be called when Chartisan tries to get the chart data. You'll get the request instance as a parameter in case you want to check for query parameters or additional info like headers, or post data. You can modify the Chartisan instance as you need.
You have to return a Chartisan instance, never a string or an object.
Register the chart
You'll need to manually register using the App\Providers\AppServiceProvider
The charts have a registered singleton that will be injected to the boot()
method on the service provider.
You can use the following example as a guide to register an example chart.
Generated routes
You can use php artisan route:list -c to see all your application routes and check out the chart routes that have been created by Chartisan in case you need them.
Chart Configuration
You can customize how some chart configuration on the laravel side by simply applying the class properties needed.
You can modify the following props on the chart:
- Middlewares
- Chart name (used to generate the URL)
- Chart route name
- Route endpoint prefix
Render Charts
Chartisan can be used without any rendering on the PHP side. Meaning it can be used and served as an API endpoint. There's no need to modify the configuration files or the chart to do such.
However, if you do not plan to develop the front-end as an SPA or in a different application and can use the
laravel Blade syntax, you can then use the @chartisan
helper to create charts.
Keep in mind that you still need to import Chartisan, and it's front-end library of your choice. The @chartisan
blade helper does accept a string containing the
chart name to get the URL of. The following example can be used as a guide:
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Nabcellent
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of chartisan with dependencies
illuminate/console Version ^9.48|^10.0|^11.0
illuminate/contracts Version ^9.48|^10.0|^11.0
illuminate/http Version ^9.48|^10.0|^11.0
illuminate/support Version ^9.48|^10.0|^11.0