Download the PHP package noki/laravel-php-graph without Composer

On this page you can find all versions of the php package noki/laravel-php-graph. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-php-graph

Laravel PHP Graph Lib

πŸ“œ History of PHP Graph Lib

The first version of PHP Graph Lib was created by Elliott Brueggeman in late 2007 πŸ™‚ β€” almost 20 years ago! Good things really do stand the test of time.

You can thank Elliott Brueggeman by giving stars to his repositories or following him. Remember, he created this library under the MIT License and made it freely available. Today, it remains one of the best PHP libraries for creating graphs and pie charts under the MIT License.

Since 2007 and the first version of this library PHP versions have changed and so the library evolved. Current version is compatible with PHP 8.2.

Current repo is forked from repository of Troopster19 and at the moment of forking code was under MIT licence.

❓ What does this package do?

This package allows you to create graph and pie chart images. You have several options for handling images, including:

[!WARNING]

Why Check Out This Package

  1. Few Laravel packages provide both graph and chart generation plus image export support.
  2. It’s lightweight, easy to integrate, and released under the MIT license for full flexibility.

πŸš€ Installation

Requirements

Composer Installation

βš™οΈ PHP GD Extension Setup

Linux (Debian/Ubuntu)

`

Example for PHP 8.3 β€” be sure to use the correct package names:

First, check your PHP version:

Then install GD for your version:

To verify if GD is installed:


macOS (with Homebrew)

The GD extension (gd) is bundled with PHP on macOS. No extra installation is usually required.

To confirm GD is enabled:


Windows

  1. Open your php.ini file.
  2. Ensure the following line is uncommented (remove the ; at the beginning):

  3. Restart your web server (Apache, Nginx) or PHP-FPM.

Verify installation

Run the following command to check if GD is enabled:


πŸ“¦ Usage

Namespace


1. Create a private graph (not publicly accessible)

With line

it is set file name without extension or directory root. Parameter 'F' is used for output to file. This file will be saved in storage/app/private/php-graph-data directory inside Laravel.

File will be saved at that route and in variable $file_path will be set route to graph image.

Important notes:

  1. Only ASCII codes are allowed in texts in PHP Graph Lib.
  2. Since the output image format is always PNG, you do not need to set a file extension β€” any extension you provide will be ignored and .png will be automatically added.

Also, if you include a directory path in the file name, it will be removed, because all images are saved in the storage/app/private/php-graph-data directory.


2. Create a public graph (publicly accessible)

Use same code as above for graph drawing just change last line

This way image will be saved to public/images/php-graph-data/ directory. This image will be publicly accessible. In variable $file_url will be returned URL to this image.

Important note:

  1. Only ASCII codes are allowed in texts in PHP Graph Lib.
  2. Since the output image format is always PNG, you do not need to set a file extension β€” any extension you provide will be ignored and .png will be automatically added.

Also, if you include a directory path in the file name, it will be removed, because all images are saved in the public/images/php-graph-data directory.


3. Save image in PHP memory and display it without save to server

This is example of creating image from Controller.

  1. Create route in routes/web.php

  2. Create controller in app/Http/TestController.php

Summary of options


πŸ§ͺ Examples

Example 1 - Graph

Creates graph:

Example 2 - Graph

Creates graph:

Example 3 - Graph

Creates graph:

Example 4 - Graph

Creates graph:

Example 5 - Graph

Creates graph:

Example 6 - Graph

Creates graph:

Example 7 - Graph

Creates graph:

Example 8 - Pie Graph

Creates pie graph:

Example 9 - Graph

Creates graph:

Example 10 - Stacked Graph

Creates graph:

Example 11 - Graph

Creates graph:


πŸ›  Error Handling


🧩 Integration with Laravel

You can easily use this package in your controllers, services, or jobs by importing the relevant namespaces:

Once imported, you can create graphs and pie charts directly in your application.


πŸ“„ License

MIT License. See LICENSE.md for details.


πŸ™Œ Contributing

Feel free to fork and submit a PR! Bug reports and feature requests are always welcome.


πŸ”— Author Of Php Graph Lib

πŸ”— Contributors


πŸ“ Changelog

Please see CHANGELOG.md for recent updates.


All versions of laravel-php-graph with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0 || ^8.0
ext-gd Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package noki/laravel-php-graph contains the following files

Loading the files please wait ...