Laravel 5.5 Integration Guide

Following is the guide to integrate PHP Grid Framework with Laravel 5.5 (LTS)

Step1: Folder placements in Laravel.

There are 2 main folders in PHP Grid Framework package archive. You need to:

Copy the contents of lib/inc folder —> Laravel/app/Classes/phpgrid
Copy the contents of lib/js folder —> Laravel/js/phpgrid

laravel_step1_1

The ‘app/Classes’ folder does not exist by default in laravel. You may create it for 3rd party class libraries.
Create another folder inside it with name ‘phpgrid’ and move all contents of ‘lib/inc’ in it. Final result will look like this:

laravel_step1_2

In similar way, copy the files from lib/js to laravel/public/js/phpgrid. Final result should look like following:

laravel_step1_3

Step2: Setting Controller code.

Here we included our library and rest code looks same as in our demos. Note the ” before class name while instantiating object. Finally we passed the output of render() function to view with a variable name ‘phpgrid_output’.

For demo purpose, we modified ‘laravel/app/Http/Controllers/WelcomeController.php’

Step2: Setting View code.

In view code, we included the JS/CSS files from the ‘js’ folder which we copied in step1.1
We also included a meta tag for ‘csrf-token‘, that is required by laravel for POST operations.

And using blade template variable output, we pushed the grid output in our desired place in html.
We also added a javascript code to pass CSRF-TOKEN in header request of ajax calls.


For demo purpose, we slightly modified ‘laravel/resources/views/welcome.blade.php’

Step3: Setting Routes

The Last step in this tutorial is to set the routes to our controller. We will use both GET and POST routes as our grid uses both methods.

Note: PHP Grid Framework does not utilize ORM model layer of Laravel. It uses it’s own backend libraries.

Result: Editable Datagrid for Laravel 5.5!

Download all files to kick-start Laravel 5.5 with PHP Grid Framework.

Note: Demo comes with non-commercial / evaluation version of php grid framework. You can buy commercial license from this link.

Use Sparklines to show trends on Datagrid

We’ve added support for visual representation of data using Sparklines in PHP Grid Framework. Sparklines charts can be used to show trends in a series of values, such as seasonal increases or decreases, website traffic, economic cycles, or to highlight maximum and minimum values. 

Now you can have Line, Bar, Composite (Both line/bar), Pie, Discrete, Bullet, Won-Lost, Color Map and Box Sparklines along with your other information. Few of them are shown in demo screenshot:

Licensed customers can request free upgrade using update link.
To purchase license, you can visit this link.

Import from Excel, Google Sheet, CSV to PHP Grid

Importing from ExcelWe’ve released ‘Import Data’ feature that will help customers who need to migrate from Microsoft Excel or Google Sheets or CSV File to their own web based solution using PHP Grid Framework.

– Import your external CSV file data in PHP Grid Framework.
– Migrating from Excel or Google Sheets to PHP Grid Framework.
– Selection to map imported data columns on database fields.
– Allow to Append OR Replace existing PHP Grid data.

Screencast below:

For How-tos, usage and technical details, refer updated documentation.

Existing customers can request update from this link.
To purchase license, you can visit this link.

Responsive PHP Grid (enhanced)

After a long delay, we have enhanced responsive feature of PHP Grid, which support some really useful intrinsic features:

– Your custom column display selection based on screen size
– Auto-hiding of columns (from end) based on screen size
– Column display choice on runtime
– Better mobile transposed display of View, Add and Edit dialog forms

Screencast #1

Screencast #2

For How-tos, usage and technical details, refer updated documentation.

Active license customers can request free upgrade using this link.

Laravel5 Integration Walkthrough

NOTE: For more complete version, Visit Laravel 5.5 Integration Guide.

Following is the guide to integrate PHP Grid Framework with Laravel 5.

laravel_result

Step1: Folder placements in Laravel.

There are 2 main folders in PHP Grid Framework package archive. You need to:

Copy the contents of lib/inc folder —> Laravel/app/Classes/phpgrid
Copy the contents of lib/js folder —> Laravel/js/phpgrid

laravel_step1_1

The ‘app/Classes’ folder does not exist by default in laravel. You may create it for 3rd party class libraries.
Create another folder inside it with name ‘phpgrid’ and move all contents of ‘lib/inc’ in it. Final result will look like this:

laravel_step1_2

In similar way, copy the files from lib/js to laravel/public/js/phpgrid. Final result should look like following:

laravel_step1_3

Step2: Setting Controller code.

Here we included our library and rest code looks same as in our demos. Note the ‘\’ before class name while instantiating object. Finally we passed the output of render() function to view with a variable name ‘phpgrid_output’.

For demo purpose, we modified ‘laravel/app/Http/Controllers/WelcomeController.php’

laravel_step2

Step2: Setting View code.

In view code, we included the JS/CSS files from the ‘js’ folder which we copied in step1.1
And using blade template variable output, we pushed the grid output in our desired place in html.
For demo purpose, we modified ‘laravel/resources/views/welcome.blade.php’

laravel_step3

Note: PHP Grid Framework does not utilize ORM model layer of Laravel. It uses it’s own backend libraries.

Result: Get Set – Go!

laravel_result

Download all files to kick-start Laravel 5 with PHP Grid Framework.

Note: Demo comes with non-commercial / evaluation version of php grid framework. You can buy commercial usage license from this link.

PHP Database Table Editor v2.0

On various occasions, we want instant access to see or edit our database tables without having time to write a whole module with add, edit, delete, list, search (CRUD) operations. Whether your database is SQL Server, Oracle, DB2, MySQL or PGSQL — PHP Grid provides you easy solution that takes database credentials in config and provide table access in form of lightweight and rich featured PHP Grid. It will provide you complete functions within your existing application admin interface.

This lightweight, yet power-featured PHP Grid Database Editor is developed by very simple code OR we can say by just configuration. In main code logic, we simply passed the dropdown value of selected table in $g->table attribute, and that’s all!

$g = new jqgrid();
// set few params
$grid["caption"] = "Grid for '$tab'";
$grid["autowidth"] = true;
$g->set_options($grid);
// set database table for CRUD operations
$g->table = $tab;
// render grid
$out = $g->render("list1");

You can extend this code to incorporate Access Control (ACL), Exporting Data (PDF, CSV, XLS) and several other features to make a powerful tool. We omitted them to show the code simplicity. This demo is based on MySQL, but you can have same function for MS SQL Server, Oracle, PgSQL databases.

Features in v1.2:

  • Selection of tables and fields for editing
  • Show/Hide particular fields in runtime
  • Bulk Editing data with multiselection
  • Grid Persistance (Column Resizing, Filters, Sort etc)

PHP Grid comes with free version and a licensed version. With Free version you can connect with others databases like MySQL, MS SQL Server, Oracle, PgSQL,DB2. Licensed version also supports many advance features which you can integrate in your application.

Complete code for this demo can be accessed from this link.

You can download and start saving your time now!

Releases:

v2.0 – May 19 2016
v1.2 – Apr 25 2015
v1.0 – Apr 8 2014