Download the PHP package centeron/laravel-grids without Composer
On this page you can find all versions of the php package centeron/laravel-grids. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-grids
Grids
Data Grids Framework for Laravel
Both Laravel 4 and Laravel 5 are supported.
Features
- Data providers (php array, Eloquent model, Doctrine DBAL query object)
- Themes support
- Individual views for UI components
- Twitter Bootstrap v3 used by default
- Caching
- Smart input handling allows to avoid conflicts with get parameters & easily place few interactive grids on same page
- Rich customization facilities
- Component architecture
- Declarative approach
- Constructing grids via strict object oriented API or configuration in php arrays
- Useful GridHelper helps to build tables fast
- Rich variety of components:
- Excel and CSV export
- Records per page dropdown
- Show/hide columns UI control
- Sorting
- Filtering
- Totals calculation (sum, average value, records count, etc)
- Pagination
- etc
Requirements
- Laravel 4.X / 5.X
- laravelcollective/html package if you use Laravel5.X
- php 5.4+
Installation
Step 1: Install package using Composer
Add centeron/laravel-grids to "require" section of your composer.json
For Laravel 5 you also need to add "laravelcollective/html":
Then install dependencies using following command:
Instead of editing composer.json and executing composer install you can just run following command:
For Laravel 4
For Laravel 5
Step 2: Laravel Setup
Add following line to 'providers' section of app/config/app.php file:
For Laravel 5 you also need to add "illuminate/html" service provider:
You may also add facade aliases to your application configuration:
Usage
Step 1. Instantiate & Configure Grid
See example below
Step 2. Render Grid
Notes
- Class names in example code used without namespaces therefore you must import it before
-
Grids does not includes Twitter Bootstrap css/js files to your layout. You need to do it manually Quick links:
- Centeron\Grids\Components\Pager component works only with Laravel 4.X, for Laravel 5 use Centeron\Grids\Components\Laravel5\Pager
Working with related Eloquent models
If you need to render data from related Eloquent models, the recommendation is to use joins instead of fetching data from related models becouse in this case filters/sorting will not work. Grids sorting and filters changes Laravel query object, but Laravel makes additional queries to get data for related models, so it's impossible to use filters/sorting with related models.
Following example demonstrates, how to construct grid that displays data from Customer model and related Country model.