adam-boduch / laravel-grid
Laravel grid package
Installs: 5 539
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 2
Forks: 5
Open Issues: 4
Requires
- php: >=7.2.0
- illuminate/http: 5.8|6.*|7.*|8.*
- illuminate/pagination: 5.8|6.*|7.*|8.*
- illuminate/support: 5.8|6.*|7.*|8.*
- illuminate/validation: 5.8|6.*|7.*|8.*
- illuminate/view: 5.8|6.*|7.*|8.*
- laravel/helpers: ^1.3
- laravelcollective/html: 5.8|6.*
- nesbot/carbon: ^2.32.0
Requires (Dev)
- orchestra/testbench: ~4
- phpunit/phpunit: ~8.5
This package is not auto-updated.
Last update: 2024-11-23 20:20:56 UTC
README
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
- Sorting
- Highly customizable
- Simple usage
- Different data source (Eloquent model, collection, array)
Installation
Requirements
- PHP >= 7.0
- Laravel >= 5.2
Installation steps
- run
composer require adam-boduch/laravel-grid
- open file
config/app.php
- add
Boduch\Grid\GridServiceProvider::class
intoproviders
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
{{ grid | raw }}
Laravel Grid and repository pattern
@todo
Laravel Grid and presentation pattern
@todo
Table cell modification
@todo
Different column name and filter name
@todo