Laravel Grid is a package that helps you display table data.

Related tags

Laravel laravel-grid
Overview

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
  • Sorting
  • 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

{{ 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

Comments
  • Can't install on laravel 5.4.24

    Can't install on laravel 5.4.24

    Running Vagrant Homestead with PHP and laravel versions: PHP 7.1.1-1+deb.sury.org~xenial+1 (cli) (built: Jan 20 2017 09:20:20) ( NTS ) Laravel Framework 5.4.24

    Run command from shell composer require boduch/laravel-grid

    Return error message [InvalidArgumentException] Could not find package boduch/laravel-grid at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

    Maybe this repo package only exists as dev-master? Any plans to release as stable?

    opened by sonicalabs 8
  • Fix filtering on Eloquent source

    Fix filtering on Eloquent source

    Code inspired by: https://github.com/vldmr-k/laravel-grid/commit/41bad34a6d3371d9e6597315edc4afd885b468e8 Related issue: https://github.com/adam-boduch/laravel-grid/issues/7

    image

    opened by Sekiphp 0
  • Scrutinizer Auto-Fixes

    Scrutinizer Auto-Fixes

    @adam-boduch requested this pull request.

    It consists of patches automatically generated for this project on Scrutinizer: https://scrutinizer-ci.com/g/adam-boduch/laravel-grid/

    opened by scrutinizer-auto-fixer 0
  • Problem with text filter

    Problem with text filter

    Hello there, consider code below:

    /** @var $grid \Boduch\Grid\Grid */
    $grid = app('grid.builder')->createBuilder();
    $grid->setDefaultOrder(new Order('id', 'desc'));
    $grid->setSource(new EloquentSource(new \App\Models\Order()));
    
    $grid->addColumn(new Column([
        'name' => 'id',
        'title' => '#',
        'sortable' => true,
        'filter' => new \Boduch\Grid\Filters\Text([
            'operator' => FilterOperator::OPERATOR_EQ,
        ]),
    ]));
    

    Grid is successfully rendered, sorting working, filter field is visible, but filtering is not working. image

    I tried to debug, but I'm not able to find the issue. It seems that method applyFilters is called, but there is no influence to SQL query.

    image

    Please, can you help me or give me some suggestion? Thank you!

    help wanted 
    opened by Sekiphp 1
  • live demo + docu

    live demo + docu

    hi, i just wanted to let you know, i´m also interested in using your grid, but i don´t have time to test every grid i see and without any live demo, its hard to decide to invest time into this. so a live demo and some docu would help here a lot ;)

    regards, micha

    opened by michabbb 1
  • Duplicated code

    Duplicated code

    see https://scrutinizer-ci.com/g/adam-boduch/laravel-grid/inspections/d040180b-21ba-49c2-b857-4ad54f2b0e3c/issues/files/src/Column.php?status=all&orderField=path&order=asc&honorSelectedPaths=0#inspectioncomment-35421850

    opened by adam-boduch 0
Releases(v2.2)
Owner
null
Data Table package with server-side processing, unlimited exporting and VueJS components

Data Table package with server-side processing, unlimited exporting and VueJS components. Quickly build any complex table based on a JSON template.

Laravel Enso 618 Dec 28, 2022
Smeify is a Stable Automated Solution for Airtime and Data businesses in Nigeria, this package helps you integrate smeify easily into your laravel application.

Smeify is a Stable Automated Solution for Airtime and Data businesses in Nigeria, this package helps you integrate smeify easily into your laravel application.

Ogundiran Adewale Charles 2 Jul 27, 2022
GeoLocation-Package - This package helps you to know the current language of the user, the country from which he is browsing, the currency of his country, and also whether he is using it vpn

GeoLocation in PHP (API) ?? ?? ?? This package helps you to know a lot of information about the current user by his ip address ?? ?? ?? This package h

Abdullah Karam 4 Dec 8, 2022
A plugin for Blessing Skin Server that can let you display Google Ads with Google AdSense in the website.

A plugin for Blessing Skin Server that can let you display Google Ads with Google AdSense in the website.

Big_Cake 2 Jan 25, 2022
This package extends Illuminate to provide partitioned table creation in migrations.

Laravel Partitions for Migrations This package extends Illuminate to provide partitioned table creation in migrations for PostgreSQL. Support for othe

ORPTech 9 Oct 24, 2022
A mostly useless package to display framework versions at the bottom of the Admin navigation panel.

A mostly useless package to display framework versions at the bottom of the Filament Admin navigation panel and an optional widget to do the same in the dashboard or custom pages.

Adam Weston 10 Nov 8, 2022
A Laravel package helps you add a complete real-time messaging system to your new / existing application with only one command.

A Laravel package helps you add a complete real-time messaging system to your new / existing application with only one command.

Munaf Aqeel Mahdi 1.7k Jan 5, 2023
This Package helps you in laravel application to log all desired activity for each request from request entry point to generate response at a single snapshot.

Laravel Scenario Logger This Package helps you in laravel application to log all desired activity for each request from request entry point to generat

Mehrdad Mahdian 6 Sep 27, 2021
This package helps you to add user based follow system to your model.

Laravel Follow User follow unfollow system for Laravel. Related projects: Like: overtrue/laravel-like Favorite: overtrue/laravel-favorite Subscribe: o

安正超 1k Dec 31, 2022
Razorpay payment gateway integration in laravel with submit form and storing details in payment table.

Integrating razorpay payment gateway in laravel with submit form and storing payment details in payment table. How to settup the project in your local

Mohammed-Thamnees 3 Apr 15, 2021
A Single Table Inheritance Trait for Eloquent/Laravel

Single Table Inheritance Credit This code is a fork of Nanigans/single-table-inheritance. I've only updated it to work with Laravel 5 Single Table Inh

Peter Haza 15 Feb 17, 2022
A make:pivot command to create a pivot table with Laravel

make:pivot for Laravel Installation Requires PHP 8.0.0+ You can install the package via composer: composer require felixdorn/laravel-make-pivot-table

Félix Dorn 13 Aug 23, 2022
A dynamic table component for Laravel Livewire - For Slack access, visit:

A dynamic Laravel Livewire component for data tables. Bootstrap 4 Demo | Bootstrap 5 Demo | Tailwind Demo | Demo Repository Installation You can insta

Anthony Rappa 1.3k Jan 1, 2023
A Single Table Inheritance Trait for Eloquent/Laravel

Single Table Inheritance Single Table Inheritance is a trait for Laravel 5.8+ Eloquent models that allows multiple models to be stored in the same dat

Jon Palmer 240 Oct 26, 2022
Laravel Kickstart is a Laravel starter configuration that helps you build Laravel websites faster.

Laravel Kickstart What is Laravel Kickstart? Laravel Kickstart is a Laravel starter configuration that helps you build Laravel websites faster. It com

Sam Rapaport 46 Oct 1, 2022
Library for generating random names (for table-top roleplaying games)

RPG-Name-Generator The RPG character name generator library is designed to create list of random names used for table-top role-playing games. This lib

Florent Genette 2 Sep 24, 2022
Creates a Filament table action.

Filament Action Designed for easy integration and manage of Filament actions. Installation You can install the package via composer: composer require

Mitesh Rathod 10 Jun 14, 2023
Laravel-OvalFi helps you Set up, test, and manage your OvalFi integration directly in your Laravel App.

OvalFi Laravel Package Laravel-OvalFi helps you Set up, test, and manage your OvalFi integration directly in your Laravel App. Installation You can in

Paul Adams 2 Sep 8, 2022
Keyword Generator Tool helps you discover keyword opportunities related to your query input.

This plugin simply helps you discover keyword opportunities related to your query input. Installation Download the zip file of the repository or clone

WP Refers 1 May 3, 2022