PHPackages                             zk/laravel-datagrid - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zk/laravel-datagrid

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zk/laravel-datagrid
===================

A lightweight and customizable DataGrid solution for Laravel, built with Blade components, lazy loading, and a powerful custom datagrid.js library for seamless frontend interactivity.

v3.2(11mo ago)064MITPHPPHP ^8.2|^8.3

Since Jan 31Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/zankatkalpesh/zk-datagrid)[ Packagist](https://packagist.org/packages/zk/laravel-datagrid)[ RSS](/packages/zk-laravel-datagrid/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

ZK DataGrid for Laravel
=======================

[](#zk-datagrid-for-laravel)

ZK DataGrid is a powerful and customizable data grid package for Laravel applications. It simplifies data representation with support for sorting, filtering, searching, pagination, and exporting.

---

✨ Features
----------

[](#-features)

- **Data Grid Management** – Easily create and manage data grids.
- **Customizable Columns** – Define and customize columns with type, formatting, search, and filter options.
- **Actions &amp; Mass Actions** – Add row-level actions and bulk actions.
- **Multiple Data Sources** – Works with arrays, collections, and query builders.
- **Blade Integration** – Predefined Blade templates for easy rendering.
- **Built-in Assets** – Includes CSS &amp; JS for interactivity and styling.
- **Export Support** – Export grid data with customizable formatters.

---

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require zk/laravel-datagrid
```

---

⚙️ Configuration
----------------

[](#️-configuration)

After installation, publish the config and views:

```
php artisan vendor:publish --tag=zk-datagrid
```

---

🚀 Usage
-------

[](#-usage)

### Create a DataGrid Class

[](#create-a-datagrid-class)

**Example: `App\DataGrid\PostGrid.php`**

```
use Zk\DataGrid\DataGrid;
use App\Models\Post;

class PostGrid extends DataGrid {

    public function prepareItems(): void
    {
        $this->fromQuery(Post::query());
    }

    public function prepareColumns(): void
    {
        // Serial No
        $this->addColumn([
            'title' => '#',
            'column' => '',
            'type' => 'serial-no',
        ]);

        // Title
        $this->addColumn([
            'column' => 'title',
            'type' => 'string',
            'sortable' => true,
            'filterable' => true,
            'searchable' => true,
        ]);

        // Status
        $this->addColumn([
            'column' => 'status',
            'type' => 'number',
            'sortable' => true,
            'formatter' => fn($item) => $item->status ? 'Active' : 'Inactive',
        ]);
    }
}
```

**In Controller:**

```
$grid = app(\App\DataGrid\PostGrid::class);
return view('post.index', ['grid' => $grid]);
```

---

🖥️ Rendering in Blade
---------------------

[](#️-rendering-in-blade)

```
{!! $grid->render() !!}
```

---

⏳ Lazy Loading (AJAX)
---------------------

[](#-lazy-loading-ajax)

Update your Blade template:

```

@push('scripts')

        document.addEventListener('DOMContentLoaded', function() {
            const dataGridLazy = new ZkDataGrid();
            dataGridLazy.render('#grid-render', "{!! $grid->toAjax() !!}");
        });

@endpush
```

---

📤 Exporting Data
----------------

[](#-exporting-data)

Export the grid data:

```
$exportData = $grid->export(); // Params: $options = []
```

- All columns are exported by default.
- To exclude a column, add `'export' => false` in its definition.
- To export **all data** (not paginated), options set \['all' =&gt; true\].
- Use the `export` formatter for custom export logic:

```
'export' => function ($item, $column, $options) {
    // Return formatted value for export
}
```

---

🔍 Searchable and Filterable Columns
-----------------------------------

[](#-searchable-and-filterable-columns)

### Searchable

[](#searchable)

```
'searchable' => true,
```

Custom search query:

```
'searchable' => function($query, $searchTerm, $column) {
    // Custom query logic
}
```

### Filterable

[](#filterable)

```
'filterable' => true,
```

Custom filter query:

```
'filterable' => function($query, $filterTerm, $column) {
    // Custom filter logic
}
```

Customize filter input:

```
'filterParams' => [
    'type' => 'select', // Options: select, checkbox, radio
    'options' => [
        ['label' => 'All', 'value' => ''],
        ['label' => 'Active', 'value' => 1],
        ['label' => 'Inactive', 'value' => 0],
    ],
    'attributes' => '', // Custom HTML attributes
]
```

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Feel free to submit issues and pull requests to enhance the package.

---

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance50

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~27 days

Total

5

Last Release

357d ago

PHP version history (2 changes)v1PHP ^8.2

v3PHP ^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/103eb4d902145de45f905c98dcb441c718c1985a6bf82e75c98445e3c20f80c9?d=identicon)[Zankat Kalpesh](/maintainers/Zankat%20Kalpesh)

---

Top Contributors

[![zankatkalpesh](https://avatars.githubusercontent.com/u/20660890?v=4)](https://github.com/zankatkalpesh "zankatkalpesh (3 commits)")

---

Tags

laravel-datagridlaravel data tableLaravel data grid componentLaravel lazy loading tabledatagrid.jsLaravel Blade UI table

### Embed Badge

![Health badge](/badges/zk-laravel-datagrid/health.svg)

```
[![Health](https://phpackages.com/badges/zk-laravel-datagrid/health.svg)](https://phpackages.com/packages/zk-laravel-datagrid)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)[wdev-rs/laravel-datagrid

Laravel integration for Grid.js server side processing

548.4k](/packages/wdev-rs-laravel-datagrid)

PHPackages © 2026

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