PHPackages                             stianscholtz/laravel-data-table - 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. stianscholtz/laravel-data-table

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

stianscholtz/laravel-data-table
===============================

A Laravel package to create data tables.

1.1.4(1y ago)076MITPHPPHP &gt;=8.0

Since Dec 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/stian-scholtz/laravel-data-table)[ Packagist](https://packagist.org/packages/stianscholtz/laravel-data-table)[ Docs](https://github.com/stian-scholtz/laravel-data-table)[ RSS](/packages/stianscholtz-laravel-data-table/feed)WikiDiscussions main Synced yesterday

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

Laravel Data Tables Package
===========================

[](#laravel-data-tables-package)

This headless Laravel package provides a convenient way to create and manage data tables in your Laravel applications. With support for various column types including boolean, date, enum, number, and text, it allows you to quickly set up and customize data tables to suit your needs.

Features
--------

[](#features)

- **Column Types:** Supports boolean, date, enum, number, and text columns.
- **Data Table Generation:** Includes a command to generate data tables with default boilerplate in the `app/DataTables` directory.
- **Search Filtering:** Support for filtering data based on the supplied search term.
- **Export Functionality:** Built-in functionality for easily exporting query results.

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

[](#installation)

You can install the package via Composer. Simply run the following command:

```
composer require stianscholtz/laravel-data-table
```

Usage
-----

[](#usage)

### Generating Data Tables

[](#generating-data-tables)

To generate a data table, use the provided Artisan command:

```
php artisan make:data-table YourDataTableProvider

```

### Defining Data Tables

[](#defining-data-tables)

In your data table class, you define the query and columns. For example:

```
use Illuminate\Contracts\Database\Query\Builder;
use Stianscholtz\LaravelDataTable\DataTableBuilder;
use Stianscholtz\LaravelDataTable\DataTableProvider;
use DB;

class YourDataTableProvider extends DataTableProvider
{
    protected bool $exportable = false;

    public function query(): Builder
    {
        /** @var Model $model */
        $model = request()->route('model');

        return DB::table('users')
        ->where('condition1', 'value')
        ->where('condition2', request('value'))
        ->when($model, fn(Builder $query) => $query->where('condition3', 'value'))
        ->select('users.id');//If you want to include the id in the data set.
    }

    public function columns(DataTableBuilder $builder): void
    {
        $builder->numberColumn('users.id', 'id', 'ID');

        if (!request()->route('model')) {
            $builder->textColumn('model.field', 'field', 'Field Name', false);
        }

        $builder->textColumn('users.name', 'user', 'User')
            ->enumColumn('users.status', 'status', 'Status')
            ->booleanColumn('IF(users.active, \'Yes\', \'No\')', 'active', 'Active')
            ->dateColumn('users.updated_at', 'updated_at', 'Updated At');
    }
}
```

### Controller

[](#controller)

```
public function index()
{
    return view('view.name', [
        'variable' => 'value',
        ...YourDataTableProvider::get(),
    ]);
    //OR
    return view('view.name', YourDataTableProvider::get(['variable' => 'value']));
}
```

### Filtering Data

[](#filtering-data)

The package automatically handles filtering data based on the supplied search term. Simply pass a 'term' in the request, and the package will filter the data accordingly.

### Exporting Data

[](#exporting-data)

The package automatically handles exporting data when $exportable is true and there is a 'export' key with a value of '1' in the request. The value of $exportable will also be available on the client side to determine if an export button should be visible.

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

[](#contributing)

Contributions are welcome! Please feel free to submit a pull request.

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance43

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Total

6

Last Release

452d ago

PHP version history (2 changes)1.0.0PHP ^8.1

1.1.3PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0774550d0655ba034a6ec17044f16ce3da0c94c23bf788e95b83a3b25210df21?d=identicon)[Stian-Scholtz](/maintainers/Stian-Scholtz)

---

Top Contributors

[![stian-scholtz](https://avatars.githubusercontent.com/u/30631131?v=4)](https://github.com/stian-scholtz "stian-scholtz (1 commits)")

---

Tags

laraveldata-tablesStian-Scholtz

### Embed Badge

![Health badge](/badges/stianscholtz-laravel-data-table/health.svg)

```
[![Health](https://phpackages.com/badges/stianscholtz-laravel-data-table/health.svg)](https://phpackages.com/packages/stianscholtz-laravel-data-table)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[firefly-iii/data-importer

Firefly III Data Import Tool.

8045.8k](/packages/firefly-iii-data-importer)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[ronasit/laravel-helpers

Provided helpers function and some helper class.

2085.6k31](/packages/ronasit-laravel-helpers)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

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

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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