PHPackages                             subhashladumor1/laravel-datatablepro - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. subhashladumor1/laravel-datatablepro

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

subhashladumor1/laravel-datatablepro
====================================

High-performance, responsive Laravel DataTables with real-time search, sorting, filtering, pagination, and advanced export capabilities

1.0.4(6mo ago)05MITPHPPHP ^8.0

Since Oct 22Pushed 6mo agoCompare

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

READMEChangelog (5)Dependencies (10)Versions (7)Used By (0)

Laravel DataTablePro
====================

[](#laravel-datatablepro)

[![Latest Version](https://camo.githubusercontent.com/491746bf38bb5ab97e656593f234ec4c2a355aad6f36cded896f8e1f603cbe9f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737562686173686c6164756d6f722f6c61726176656c2d646174617461626c6570726f2e737667)](https://packagist.org/packages/subhashladumor/laravel-datatablepro)[![Total Downloads](https://camo.githubusercontent.com/b2c434ae3ae02299843de3038b88c0ce1b7454881907f853b6d4a9725f980f04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737562686173686c6164756d6f722f6c61726176656c2d646174617461626c6570726f2e737667)](https://packagist.org/packages/subhashladumor/laravel-datatablepro)[![License](https://camo.githubusercontent.com/79e7c60a235aa8501a0875ce051bca9b4f51e4dc3ae0cb75495a9e6e87e23a08/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f737562686173686c6164756d6f722f6c61726176656c2d646174617461626c6570726f2e737667)](https://packagist.org/packages/subhashladumor/laravel-datatablepro)

A high-performance, feature-rich Laravel package for creating responsive DataTables with real-time search, sorting, filtering, pagination, and advanced export capabilities (CSV, PDF, XLSX, Image) without page reloads.

🚨 Quick Fix for Common Errors
-----------------------------

[](#-quick-fix-for-common-errors)

### Error: "Can't locate path: .../Resources/dist"

[](#error-cant-locate-path-resourcesdist)

**Solution:** Build the assets first!

```
# Windows (PowerShell)
.\quick-fix.bat

# Linux/Mac
chmod +x quick-fix.sh
./quick-fix.sh
```

**OR manually:**

```
cd vendor/subhashladumor/laravel-datatablepro
npm install
npm run build
cd ../../..
php artisan vendor:publish --provider="SubhashLadumor1\\DataTablePro\\Providers\\DataTableServiceProvider" --tag="datatable-assets" --force
```

### Error: "DTable is not defined"

[](#error-dtable-is-not-defined)

**Solution:** Make sure your layout has:

```

@stack('styles')

@stack('scripts')
```

See [BUILD.md](BUILD.md) for detailed troubleshooting.

Features
--------

[](#features)

✨ **Core Features:**

- Fluent, Yajra-compatible API
- Eloquent, Query Builder, and Collection support
- Real-time search across multiple columns and relationships
- Multi-column sorting (including relationship columns)
- Advanced filtering (text, select, date-range, numeric-range, custom callbacks)
- Responsive design with mobile card layout
- Server-side and client-side rendering
- XSS protection with safe HTML escaping

🚀 **Advanced Features:**

- **Export System**: CSV (streaming), XLSX (chunked &amp; queued), PDF, Image (html2canvas)
- **Virtual Scrolling**: Handle large datasets efficiently
- **Realtime Updates**: Polling or WebSocket support
- **Column Persistence**: Save column visibility and order per user
- **Custom Renderers**: Built-in renderers (link, avatar, badge, date, currency, etc.)
- **Whitelisting**: Secure column and relationship access control
- **Deep Linking**: History API integration for shareable states

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

[](#requirements)

- PHP ^8.2
- Laravel ^10.0 | ^11.0

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

[](#installation)

```
composer require subhashladumor/laravel-datatablepro
```

### Optional Dependencies

[](#optional-dependencies)

```
# For XLSX export
composer require maatwebsite/excel

# For PDF export
composer require barryvdh/laravel-dompdf

# For advanced image processing
composer require intervention/image
```

### Publish Assets

[](#publish-assets)

```
# Publish configuration
php artisan vendor:publish --provider="SubhashLadumor1\\DataTablePro\\Providers\\DataTableServiceProvider" --tag="datatable-config"

# Publish views
php artisan vendor:publish --provider="SubhashLadumor1\\DataTablePro\\Providers\\DataTableServiceProvider" --tag="datatable-views"

# Publish assets (after building - see above)
php artisan vendor:publish --provider="SubhashLadumor1\\DataTablePro\\Providers\\DataTableServiceProvider" --tag="datatable-assets"

# Run migrations for table presets
php artisan migrate
```

### Build Frontend Assets

[](#build-frontend-assets)

```
npm install
npm run build
```

Quick Start
-----------

[](#quick-start)

### 1. Create a Controller

[](#1-create-a-controller)

```
use SubhashLadumor1\DataTablePro\DataTable\Builder;
use SubhashLadumor1\DataTablePro\DataTable\Column;
use App\Models\User;

class UserController extends Controller
{
    public function index()
    {
        return view('users.index');
    }

    public function datatable(Request $request)
    {
        return Builder::make()
            ->eloquent(User::query())
            ->columns([
                Column::make('id', 'ID')->orderable(),
                Column::make('name', 'Name')->searchable()->orderable(),
                Column::make('email', 'Email')->searchable(),
                Column::make('created_at', 'Created')->orderable()
                    ->format(fn($value) => $value->format('Y-m-d')),
            ])
            ->with(['posts', 'profile'])
            ->pageLength(25)
            ->responsive()
            ->exportable()
            ->toResponse($request);
    }

    public function export(Request $request)
    {
        return Builder::make()
            ->eloquent(User::query())
            ->columns([
                Column::make('name', 'Name')->exportable(),
                Column::make('email', 'Email')->exportable(),
            ])
            ->exportable()
            ->toExport($request->get('format', 'csv'), $request);
    }
}
```

### 2. Add Routes

[](#2-add-routes)

```
Route::get('/users', [UserController::class, 'index']);
Route::post('/users/datatable', [UserController::class, 'datatable']);
Route::post('/users/export', [UserController::class, 'export']);
```

### 3. Create Blade View

[](#3-create-blade-view)

```
@extends('layouts.app')

@section('content')

@endsection
```

Advanced Usage
--------------

[](#advanced-usage)

### Custom Renderers

[](#custom-renderers)

**Server-side rendering:**

```
Column::make('status', 'Status')
    ->render(function ($value, $row) {
        return "" . ucfirst($value) . "";
    })
    ->raw(); // Allow HTML
```

**Client-side rendering:**

```
// In your controller
Column::make('avatar', 'Avatar')
    ->render('avatar') // Use built-in avatar renderer
    ->attributes(['imageKey' => 'avatar_url', 'size' => 40]);

Column::make('price', 'Price')
    ->render('currency')
    ->attributes(['currency' => 'USD', 'symbol' => '$']);
```

### Filters

[](#filters)

```
use SubhashLadumor1\DataTablePro\DataTable\Filter;

Builder::make()
    ->eloquent(User::query())
    ->filters([
        Filter::text('name', 'Search Name'),
        Filter::select('status', 'Status', [
            'active' => 'Active',
            'inactive' => 'Inactive'
        ]),
        Filter::dateRange('created_at', 'Registration Date'),
        Filter::numericRange('age', 'Age'),

        // Custom filter with callback
        Filter::make('custom', 'select', 'Department')
            ->options(['IT' => 'IT', 'HR' => 'HR'])
            ->callback(function ($query, $value) {
                $query->whereHas('department', fn($q) => $q->where('name', $value));
            }),
    ]);
```

### Relationship Columns

[](#relationship-columns)

```
Builder::make()
    ->eloquent(Post::query())
    ->columns([
        Column::make('title', 'Title'),
        Column::make('name', 'Author')
            ->relationship('user') // belongsTo relationship
            ->searchable()
            ->orderable(),
    ])
    ->with(['user']); // Eager load to avoid N+1
```

### Export Configuration

[](#export-configuration)

```
// Simple export
Builder::make()
    ->eloquent(User::query())
    ->columns([
        Column::make('name', 'Name')->exportable(),
        Column::make('email', 'Email')->exportable(),
        Column::make('password', 'Password')->exportable(false), // Exclude from export
    ])
    ->exportable()
    ->toExport('xlsx', $request);
```

For large datasets, queued exports are automatically triggered and a signed download URL is returned.

### Virtual Scrolling

[](#virtual-scrolling)

```
Builder::make()
    ->eloquent(User::query())
    ->columns([...])
    ->virtualScroll()
    ->pageLength(100);
```

### Realtime Updates

[](#realtime-updates)

```
Builder::make()
    ->eloquent(User::query())
    ->columns([...])
    ->realtime(); // Poll every 5 seconds (default)
```

Verification Checklist
----------------------

[](#verification-checklist)

To verify the package locally:

```
# 1. Install dependencies
composer install
npm install

# 2. Build assets
npm run build

# 3. Publish package resources
php artisan vendor:publish --provider="SubhashLadumor1\DataTablePro\Providers\DataTableServiceProvider" --tag="datatable-views"
php artisan vendor:publish --provider="SubhashLadumor1\DataTablePro\Providers\DataTableServiceProvider" --tag="datatable-assets"

# 4. Run migrations
php artisan migrate

# 5. Run tests
composer test

# 6. Run static analysis
composer static

# 7. Check code style
composer cs-check
```

Documentation
-------------

[](#documentation)

- [Usage Guide](docs/usage.md) - Comprehensive usage examples
- [API Reference](docs/api.md) - Complete API documentation
- [Examples](docs/examples.md) - Real-world examples
- [Implementation Details](IMPLEMENTATION.md) - Design rationale and trade-offs
- [Upgrade Guide](UPGRADE.md) - Migration guide between versions

Contributing
------------

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Subhash Ladumor](https://github.com/subhashladumor1)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

Changelog
---------

[](#changelog)

Please see [CHANGELOG.md](CHANGELOG.md) for recent changes.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance66

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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 ~0 days

Total

5

Last Release

202d ago

### Community

Maintainers

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

---

Top Contributors

[![subhashladumor1](https://avatars.githubusercontent.com/u/79623012?v=4)](https://github.com/subhashladumor1 "subhashladumor1 (13 commits)")

---

Tags

laravelpdfexportxlsxcsvdatatablesrealtimeresponsivedatatable

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/subhashladumor1-laravel-datatablepro/health.svg)

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

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M712](/packages/maatwebsite-excel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[nilgems/laravel-textract

A Laravel package to extract text from files like DOC, XL, Image, Pdf and more. I've developed this package by inspiring "npm textract".

195.2k](/packages/nilgems-laravel-textract)

PHPackages © 2026

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