This example shows how to use Anychart library with the PHP programming language, Laravel framework and MySQL database.

Overview

AnyChart - Robust JavaScript/HTML5 Chart library for any project

PHP basic template

This example shows how to use Anychart library with the PHP programming language, Laravel framework and MySQL database.

Running

To use this sample you must have PHP installed, if not, please, install it as described here; MySQL installed and running, if not, please, check out MySQL download page and follow these instructions; and Composer, if not, please, check out Composer installation guide.

To check your installations, run the following command in the command line:

$ php -v
PHP 5.6.27-1+deb.sury.org~trusty+1 (cli)  # sample output
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

$ mysql --version
mysql  Ver 14.14 Distrib 5.5.52, for debian-linux-gnu (x86_64) using readline 6. # sample output

$ composer -V
Composer version 1.2.1 2016-09-12 11:27:19 # sample output

To start this example run commands listed below.

Clone the repository from github.com:

$ git clone [email protected]:anychart-integrations/php-laravel-mysql-template.git

Navigate to the repository folder:

$ cd php-laravel-mysql-template

Install dependencies:

$ composer install

Ensure you have php-mysql, php-mbstring, php-xml being installed, run:

$ php -m

If there isn't 'mysql', 'xml' or 'mbstring' in the list, install it:

# to install php-mysql, run:
$ sudo apt-get install php{your_php_version}-mysql # e.g. sudo apt-get install php5.6-mysql

# to install php-mbstring, run:
$ sudo apt-get install php{your_php_version}-mbstring # e.g. sudo apt-get install php5.6-mbstring

# to install php-xml, run:
$ sudo apt-get install php{your_php_version}-xml # e.g. sudo apt-get install php5.6-xml

Set up MySQL database, use -u -p flags to provide username and password:

$  mysql < database_backup.sql

Run example:

$ php artisan serve

Open browser at http://localhost:8000/

Workspace

Your workspace should look like:

php-laravel-mysql-template/
    app/               
        ...
        Http/
            ...
            Controllers/
                ...
                ChartController.php     # Main controller to render chart
    bootstrap/
    config/
    database/
    public/
        ...
        css/
            ...
            style.css       # css style
    resources/
        ...
        views
            ...
            chart.blade.php     # html template
    routes/
        ...
        web.php             # routes
    storage/
    tests/
    ...
    .env                    # main project settings, MySQL settings here
    .env.example
    .gitattributes
    .gitignore
    artisan
    composer.json           # composer project settings
    composer.lock
    database_backup.sql     # MySQL database dump
    gulpfile.js
    LICENSE
    package.json
    phpunit.xml
    README.md
    server.php
    yarn.lock

More about Laravel directory structure you can read here: https://laravel.com/docs/5.3/structure

Technologies

Language - PHP
Database - MySQL
Web framework - Laravel

Further Learning

License

AnyChart PHP/Laravel/MySQL integration sample includes two parts:

  • Code of the integration sample that allows to use Javascript library (in this case, AnyChart) with Laravel framework, PHP language and MySQL database. You can use, edit, modify it, use it with other Javascript libraries without any restrictions. It is released under Apache 2.0 License.
  • AnyChart JavaScript library. It is released under Commercial license. You can test this plugin with the trial version of AnyChart. Our trial version is not limited by time and doesn't contain any feature limitations. Check details here.

If you have any questions regarding licensing - please contact us. [email protected]

Analytics

You might also like...
A PHP MySQL database client class to simplify database access

This lightweight database class is written with PHP and uses the MySQLi extension, it uses prepared statements to properly secure your queries, no need to worry about SQL injection attacks.

A simple functional programming library for PHP
A simple functional programming library for PHP

bingo-functional A simple functional programming library for PHP. Requirement(s) PHP 7 or higher Rationale PHP, a language not commonly associated wit

Small library providing some functional programming tools for PHP, based on Rambda

Functional library for PHP. Features: set of useful functions helpful in functional programming all functions are automatically curried every array ca

Dashboard that shows who pings your linux box - PHP and TCPDUMP

server-ping-alert Dashboard that shows who pings your linux box - PHP and TCPDUMP This uses tcpdump and php to see who is pinging your linux box. This

PHP_Depend is an adaptation of the established Java development tool JDepend. This tool shows you the quality of your design in terms of extensibility, reusability and maintainability.

PHP Depend Documentation PHP Depend for enterprise Available as part of the Tidelift Subscription. The maintainers of PHP Depend and thousands of othe

This demo app shows you how to run a simple PHP application on AWS Elastic Beanstalk.

Elastic Beanstalk + PHP Demo App - "Share Your Thoughts" This demo app shows you how to run a simple PHP application on AWS Elastic Beanstalk. Run the

A Pocketmine-MP (PMMP) leaderboard plugin that shows player statistics on a website.

WebLeaderBoard A Pocketmine-MP (PMMP) leaderboard plugin that shows all sorts of statistics on a website. Setup Guide To start using the plugin, downl

Shows you the current diocese that you're in, as well as the bishop.

Use config.php to create variables $dbuser and $dbpass for the database connection. Run `php -f ./coa/newcheck.php` to update database information fr

My intention with this app is that new developers can have a concrete application with Laravel + VueJS where they can use it as example to learn the right way
My intention with this app is that new developers can have a concrete application with Laravel + VueJS where they can use it as example to learn the right way

My intention with this app is that new developers can have a concrete application with Laravel + VueJS where they can use it as example to learn the right way, implementing the best practices possible and at the same time learn how TDD is done. So this will be an example application but completely usable for any similar case.

Owner
AnyChart Integrations and Templates
AnyChart can run on any platform and with any database
AnyChart Integrations and Templates
A repository for showcasing my knowledge of the PHP programming language, and continuing to learn the language.

Learning PHP (programming language) I know very little about PHP. This document will list all my knowledge of the PHP programming language. Basic synt

Sean P. Myrick V19.1.7.2 2 Oct 29, 2022
This example shows how to estimate pi, using generated random numbers that uniformly distributed.

php-estimatepi This example shows how to estimate pi, using generated random numbers that uniformly distributed. Every pair of numbers produced will b

Oğuzhan Cerit 1 Nov 26, 2021
Roach-example-project - Example project to demonstrate how to use RoachPHP in a Laravel project.

Example repository to illustrate how to use roach-php/laravel in a Laravel app. Check app/Spiders/FussballdatenSpider.php for an example spider that c

Kai Sassnowski 11 Dec 15, 2022
This is a plugin written in PHP programming language and running on the PocketMine platform that works stably on the API 3.25.0 platform

This is a plugin written in PHP programming language and running on the PocketMine platform that works stably on the API 3.25.0 platform. It allows you to hear the sound

Thành Nhân 10 Sep 27, 2022
Bearer client for the PHP programming language

Bearer PHP Client This is the official PHP client for interacting with Bearer.sh. Installation Install the package by running: composer require bearer

Bearer 9 Oct 31, 2022
All about docker projects either from dockerfile or compose. Anyway, here the project is in the form of a service, for the programming language I will make it later

Docker Project by ItsArul Hey, yo guys okay, this time I made some projects from Docker. Anyway, this project is open source, for example, if you want

Kiyo 10 Nov 4, 2022
PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP language

php-text-analysis PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP l

null 464 Dec 28, 2022