LaravelPackages.net
Acme Inc.
Toggle sidebar
adam-boduch/laravel-grid

Laravel grid package

5.834
9
v2.2
About adam-boduch/laravel-grid

adam-boduch/laravel-grid is a Laravel package for laravel grid package. It currently has 9 GitHub stars and 5.834 downloads on Packagist (latest version v2.2). Install it with composer require adam-boduch/laravel-grid. Discover more Laravel packages by adam-boduch or browse all Laravel packages to compare alternatives.

Last updated

Laravel Grid

Build Status Scrutinizer Code Quality SensioLabsInsight StyleCI

Laravel Grid is a package that helps you display table data. I could not find package that would satisfy my needs so I decided to write one. Now I've been successfully using it in my two projects. I hope you will enjoy it.

Example:

namespace App\Http\Controllers;

use Boduch\Grid\Order;
use Boduch\Grid\Source\EloquentSource;

class UsersController extends Controller
{
    public function index()
    {
        $grid = app('grid.builder')
            ->createBuilder()
            ->setDefaultOrder(new Order('id', 'desc'))
            ->addColumn('id', [
                'sortable' => true
            ])
            ->addColumn('name')
            ->addColumn('email')
            ->addColumn('created_at')
            ->setSource(new EloquentSource(new \App\Models\User()));
            
        return view('users')->with('grid', $grid);
    }
    
}

Features

  • Pagination
  • Filtering
  • Highly customizable
  • Simple usage
  • Different data source (Eloquent model, collection, array)

Installation

Requirements

  • PHP >= 7.0
  • Laravel >= 5.2

Installation steps

  1. run composer require adam-boduch/laravel-grid
  2. open file config/app.php
  3. add Boduch\Grid\GridServiceProvider::class into providers array

Getting started

To keep your controllers clean, it's highly recommended to keep your grid classes as a separate php file.

Cookbook

Using twig

@todo

Laravel Grid and repository pattern

@todo

Laravel Grid and presentation pattern

@todo

Table cell modification

@todo

Different column name and filter name

@todo

Comments