PHPackages                             bored-programmers/laragrid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. bored-programmers/laragrid

ActiveLibrary[Search &amp; Filtering](/categories/search)

bored-programmers/laragrid
==========================

LaraGrid is a powerful and customizable grid system package for Laravel. It provides an easy way to create sortable, filterable tables with pagination. The package is designed to be highly customizable, allowing developers to define columns, apply filters, and sort data with ease.Key Features:- \*\*Column Definition\*\*: LaraGrid allows you to define the columns that will be displayed in the grid. You can specify the model field and the label for each column.- \*\*Filters\*\*: The package provides several filter classes out of the box, including text, select, date, and boolean filters. These filters can be applied to the columns to filter the grid's data based on user input.- \*\*Sorting\*\*: LaraGrid supports sorting of data based on any column. It also provides support for sorting data based on a related model's field using PowerJoins.- \*\*Pagination\*\*: The package integrates with Laravel's pagination system, allowing you to easily paginate the data in the grid.- \*\*Customizable Appearance\*\*: LaraGrid allows you to customize the appearance of the grid by extending the `BaseLaraGridTheme` class and setting the desired CSS classes.- \*\*Livewire Integration\*\*: LaraGrid is built with Livewire, a full-stack framework for Laravel that makes building dynamic interfaces simple, without leaving the comfort of Laravel.The package is currently in development and is not ready for use in production. It requires PHP 8.1 or higher and Laravel 10.0 or higher.

v1.2.7(2y ago)398MITPHP

Since Sep 30Pushed 2y agoCompare

[ Source](https://github.com/Bored-Programmers/laragrid)[ Packagist](https://packagist.org/packages/bored-programmers/laragrid)[ RSS](/packages/bored-programmers-laragrid/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (30)Used By (0)

LaraGrid
========

[](#laragrid)

🚧 **This package is in development, and is not ready for use in production yet.** 🚧

[![LaraGrid Logo](./resources/assets/img/logo.png)](./resources/assets/img/logo.png)

[![Latest Stable Version](https://camo.githubusercontent.com/1b485564444b0a8a96b42890b86aefe84ae208637734469d0a30892038d49448/68747470733a2f2f706f7365722e707567782e6f72672f626f7265642d70726f6772616d6d6572732f6c617261677269642f76)](//packagist.org/packages/bored-programmers/laragrid)[![Total Downloads](https://camo.githubusercontent.com/5594aaf92461fa9852bf268d985b8a48215fb2699772d54422690e83be99fc32/68747470733a2f2f706f7365722e707567782e6f72672f626f7265642d70726f6772616d6d6572732f6c617261677269642f646f776e6c6f616473)](//packagist.org/packages/bored-programmers/laragrid)[![License](https://camo.githubusercontent.com/d74b73ca6c13245ede4461140aa8390a0d4c05c4e197902e24068a235813d4a1/68747470733a2f2f706f7365722e707567782e6f72672f626f7265642d70726f6772616d6d6572732f6c617261677269642f6c6963656e7365)](//packagist.org/packages/bored-programmers/laragrid)

LaraGrid is a Laravel package that provides a powerful and customizable grid system. It allows you to easily create sortable, filterable tables with pagination.

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Publishable Assets](#publishable)
- **[Documentation](https://boredprogrammers.gitbook.io/laragrid)**
- [Usage](#base-usage)
    - [Creating a Grid](#creating-a-grid)
    - [Displaying the Grid](#displaying-the-grid)
    - [Customizing the Theme](#customizing-the-theme)
- [Contribution Guidelines](#contribution-guidelines)
- [Changelog](#changelog)
- [License](#license)
- [Contact Information](#contact-information)
- [Acknowledgments](#acknowledgments)

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.0 or higher

Installation
------------

[](#installation)

To install LaraGrid, you need to run the following command:

```
composer require bored-programmers/laragrid
```

Publishable
-----------

[](#publishable)

You can publish the package's configuration, language files, and views using the following commands:

***required***

```
php artisan vendor:publish --tag=laragrid-assets
```

***optional***

```
php artisan vendor:publish --tag=laragrid-config
php artisan vendor:publish --tag=laragrid-lang
php artisan vendor:publish --tag=laragrid-views
```

TODO List
---------

[](#todo-list)

1. Write tests for all functionality

Base Usage
----------

[](#base-usage)

### Creating a Grid

[](#creating-a-grid)

To create a grid, you need to extend the `BaseLaraGrid` class and implement the `getColumns`, and `getDataSource` methods.

```
use BoredProgrammers\LaraGrid\Components\ColumnComponents\Column;
use BoredProgrammers\LaraGrid\Livewire\BaseLaraGrid;
use Illuminate\Database\Eloquent\Builder;
use BoredProgrammers\LaraGrid\Filters\FilterResetButton;

class MyGrid extends BaseLaraGrid
{

    protected function getColumns(): array
    {
        return [
            Column::make('id', 'ID'),
            Column::make('name', 'Name'),
            // Add more columns as needed
        ];
    }

    protected function getDataSource(): Builder
    {
        return MyModel::query();
    }

}
```

In the `getColumns` method, you define the columns that will be displayed in the grid. The `Column::make` method takes two arguments: the model field and the label.

The `getDataSource` method should return an instance of `Illuminate\Database\Eloquent\Builder` for the model you want to display in the grid.

### Displaying the Grid

[](#displaying-the-grid)

To display the grid in a Blade view, you can use the `@livewire` or `` directive:

```
@livewire('my-grid')
```

```

```

*Replace `'my-grid'` with the actual name of your Livewire component.*

### Customizing the Theme

[](#customizing-the-theme)

You can customize the appearance of the grid by extending the `BaseLaraGridTheme` class and setting the desired CSS.

```
use BoredProgrammers\LaraGrid\Theme\BaseLaraGridTheme;
use BoredProgrammers\LaraGrid\Theme\FilterTheme;
use BoredProgrammers\LaraGrid\Theme\TBodyTheme;
use BoredProgrammers\LaraGrid\Theme\THeadTheme;

class MyTheme extends BaseLaraGridTheme
{

    public static function make(): static
    {
        $theme = new static();

        $theme->setTableClass('min-w-full table-auto');

        $theme->setTheadTheme(
            THeadTheme::make()
                ->setTheadClass('pb-4')
                ->setThClass('pb-3 px-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap')
        );

        $theme->setTbodyTheme(
            TBodyTheme::make()
                ->setEmptyMessageClass('text-white')
                ->setTdClass('whitespace-nowrap p-3 text-sm text-gray-500')
                ->setGroupTdClass('whitespace-nowrap flex items-center p-3 text-sm text-gray-500')

                ->setRecordTrClass(fn($record) => $record->role === 'admin' ? 'bg-red-500' : 'bg-white'); // you can also set a closure for record tr class. Pass a closure that returns a string class.
                ->setRecordTrClass('bg-white odd:bg-gray-100'); // If you don't want to set a closure, you can just pass a string class.
        );

        $theme->setFilterTheme(
            FilterTheme::make()
                ->setFilterTextClass('bg-white w-full rounded-xl border border-gray-300')
                ->setFilterSelectClass('bg-white w-full rounded-xl border border-gray-300')
                ->setFilterDateClass('bg-white w-full rounded-xl border border-gray-300')
        );

        // those are not all methods, you can find all of them in BaseLaraGridTheme, THeadTheme, TBodyTheme and FilterTheme classes

        return $theme;
    }

}
```

Then, in your grid class, you need to override the `getTheme` method and return an instance of your theme class.

```
    protected function getTheme(): BaseLaraGridTheme
    {
        return MyTheme::make();
    }
```

By default, there is a theme called `TailwindTheme`.

Show filtering and sorting in url
---------------------------------

[](#show-filtering-and-sorting-in-url)

If you want to show filtering and sorting in url, you need to rewrite default LaraGrid properties. You can do it like this:

```
abstract class MyBaseGrid extends BaseLaraGrid
{

    #[Url]
    public array $filter = [];

    #[Url(except: 'id')]
    public string $sortColumn = 'id';

    #[Url]
    public string $sortDirection = 'desc';

    protected function getFilterResetButton(): FilterResetButton
    {
        return FilterResetButton::make();
    }

    protected function getTheme(): BaseLaraGridTheme
    {
        return MyTheme::make();
    }

}
```

Those Url params are default from livewire, so you can customize them as you want by following [livewire docs](https://livewire.laravel.com/docs/url#initializing-properties-from-the-url).

Contribution Guidelines
-----------------------

[](#contribution-guidelines)

We welcome contributions to LaraGrid. If you'd like to contribute, please fork the repository, make your changes, and submit a pull request. We have a few requirements for contributions:

- Follow the PSR-2 coding standard.
- Write tests for new features and bug fixes.
- Only use pull requests for contributions.

Changelog
---------

[](#changelog)

For a detailed history of changes, see [releases](https://github.com/Bored-Programmers/laragrid/releases) on GitHub.

License
-------

[](#license)

This project is licensed under the [MIT license](https://github.com/Bored-Programmers/laragrid/blob/main/LICENSE.md).

Contact Information
-------------------

[](#contact-information)

For any questions or concerns, please feel free to create a [discussion](https://github.com/Bored-Programmers/laragrid/discussions) on GitHub.

Credits
-------

[](#credits)

Created by [Matěj Černý](https://github.com/LeMatosDeFuk)from [Bored Programmers](https://github.com/Bored-Programmers).

Acknowledgments
---------------

[](#acknowledgments)

We would like to thank all the contributors who have helped to make LaraGrid a better package.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

26

Last Release

868d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f39e259d02db301423292232c2f6fb5255c2cb51d4b22a0751ff0e06dc5dc5a?d=identicon)[Blazik](/maintainers/Blazik)

![](https://www.gravatar.com/avatar/e7383a3630c17f193886f833a3f5ba617d172ae0cb203c75aeaca6a82cc94320?d=identicon)[LeMatosDeFuk](/maintainers/LeMatosDeFuk)

---

Top Contributors

[![LeMatosDeFuk](https://avatars.githubusercontent.com/u/45625770?v=4)](https://github.com/LeMatosDeFuk "LeMatosDeFuk (147 commits)")[![Blazik](https://avatars.githubusercontent.com/u/26843703?v=4)](https://github.com/Blazik "Blazik (2 commits)")

---

Tags

gridgrid-systemlaragridlaravellaravel-frameworklaravel-gridlaravel-laragridlivewirelaravelpaginationfiltergridsortlivewiretable

### Embed Badge

![Health badge](/badges/bored-programmers-laragrid/health.svg)

```
[![Health](https://phpackages.com/badges/bored-programmers-laragrid/health.svg)](https://phpackages.com/packages/bored-programmers-laragrid)
```

###  Alternatives

[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

116.6k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
