PHPackages                             nion/laravel-model-datatable - 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. [Templating &amp; Views](/categories/templating)
4. /
5. nion/laravel-model-datatable

ActiveLibrary[Templating &amp; Views](/categories/templating)

nion/laravel-model-datatable
============================

A Laravel package for generating dynamic data tables using Blade components.

1.0.2(1y ago)06MITPHP

Since Mar 8Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (4)Used By (0)

Laravel Model Datatable
=======================

[](#laravel-model-datatable)

A simple and powerful package for handling datatables in Laravel applications.

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

[](#installation)

You can install the package via composer:

```
composer require nion/model-datatable
```

The package will automatically register its service provider.

Usage
-----

[](#usage)

### 1. Publish the configuration (optional)

[](#1-publish-the-configuration-optional)

```
php artisan vendor:publish --provider="Nion\ModelDatatable\Providers\ModelDataTableServiceProvider" --tag="config"
```

### 2. Add the trait to your model

[](#2-add-the-trait-to-your-model)

```
use Nion\ModelDatatable\Traits\HasDataTable;

class User extends Model
{
    use HasDataTable;

    // Define your columns
    protected $datatableColumns = [
        'id' => 'ID',
        'name' => 'Name',
        'email' => 'Email',
        'created_at' => 'Created At'
    ];
}
```

### 3. In your controller

[](#3-in-your-controller)

```
public function index()
{
    $users = User::datatable();

    if (request()->ajax()) {
        return $users;
    }

    return view('users.index', compact('users'));
}
```

### 4. In your blade view

[](#4-in-your-blade-view)

```

            ID
            Name
            Email
            Created At

@push('scripts')

$(document).ready(function() {
    $('#users-table').DataTable({
        processing: true,
        serverSide: true,
        ajax: "{{ route('users.index') }}",
        columns: [
            {data: 'id', name: 'id'},
            {data: 'name'},
            {data: 'email'},
            {data: 'created_at'}
        ]
    });
});

@endpush
```

Features
--------

[](#features)

- Server-side processing
- Automatic column handling
- Search functionality
- Sorting functionality
- Pagination
- Custom column formatting
- Relationship handling

Configuration
-------------

[](#configuration)

You can customize the package behavior by publishing the config file:

```
// config/model-datatable.php
return [
    'default_per_page' => 15,
    'search_columns' => ['name', 'email'],
    'date_format' => 'Y-m-d H:i:s',
];
```

License
-------

[](#license)

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

Laravel Model DataTable
=======================

[](#laravel-model-datatable-1)

[![Latest Version](https://camo.githubusercontent.com/679321f6acf444c58edc40fc73e5a14eb6eeed29d1ba3d4fed124ba4897b39fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e696f6e2f6c61726176656c2d6d6f64656c2d646174617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nion/laravel-model-datatable)[![Total Downloads](https://camo.githubusercontent.com/b7fe5c17c777600ca81f19a705bfcd3fcb7599271f9f11df3080033f34066743/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e696f6e2f6c61726176656c2d6d6f64656c2d646174617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nion/laravel-model-datatable)[![License](https://camo.githubusercontent.com/4164de2f0fd16a23a955597ccada9ea1c6f978db0d045e78fec1dc1348ce500e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e696f6e2f6c61726176656c2d6d6f64656c2d646174617461626c652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

**Laravel Model DataTable** makes it easy to generate **dynamic data tables** directly from Eloquent models in Blade templates.

Supports:

- **Bootstrap**, **Tailwind**, or **Custom Views**
- **Automatic table rendering from models**
- **Customizable and extendable UI**

---

🚀 Installation
--------------

[](#-installation)

You can install the package via **Composer**:

```
composer require nion/laravel-model-datatable
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance48

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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

Total

3

Last Release

420d ago

### Community

Maintainers

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

---

Top Contributors

[![thanhnhan0974](https://avatars.githubusercontent.com/u/64397349?v=4)](https://github.com/thanhnhan0974 "thanhnhan0974 (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nion-laravel-model-datatable/health.svg)

```
[![Health](https://phpackages.com/badges/nion-laravel-model-datatable/health.svg)](https://phpackages.com/packages/nion-laravel-model-datatable)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

545.8M69](/packages/symfony-ux-icons)

PHPackages © 2026

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