PHPackages                             thaile/metronic-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. [Admin Panels](/categories/admin)
4. /
5. thaile/metronic-datatable

ActiveLibrary[Admin Panels](/categories/admin)

thaile/metronic-datatable
=========================

using datatable in metronic template admin

0811—0%[1 issues](https://github.com/thaile0101/metronic-datatable/issues)HTML

Since Jan 14Pushed 7y agoCompare

[ Source](https://github.com/thaile0101/metronic-datatable)[ Packagist](https://packagist.org/packages/thaile/metronic-datatable)[ RSS](/packages/thaile-metronic-datatable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

### [![](https://camo.githubusercontent.com/121334458fd245d900fab425c019e61008487a789bbaf10b5203260b4f64979b/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f76692f392f39312f46435f42617263656c6f6e615f6c6f676f2e737667)](https://camo.githubusercontent.com/121334458fd245d900fab425c019e61008487a789bbaf10b5203260b4f64979b/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f76692f392f39312f46435f42617263656c6f6e615f6c6f676f2e737667)

[](#)

Metronic datatable
==================

[](#metronic-datatable)

This package allows you to use datatables as a plugin to perform CRUD actions in admin panel via AJAX calls.

Table of Contents
=================

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Configuration](#configuration)
    - [Table configuration](#table-configuration)
    - [Column configuration](#column-configuration)
    - [Bulk action configuration](#bulk-action-configuration)

Requirements
============

[](#requirements)

- PHP &gt;= 5.6
- Laravel &gt;= 5.4

Beside that, this package also requires some packages

- jQuery &gt;= 1.9
- jQuery blockUI :
- jQuery input mask :
- Bootstrap &gt;= 3 :
- Bootstrap date time picker
- Bootstrap select and select2
- MomentJS :
- Toastr :
- Metronic theme :
- Font awesome :
- Datatables :

Installation
============

[](#installation)

Update the composer.json file:

```
{
    "require": {
        "thaile/metronic-datatable": "dev-master",
    }
}

```

From the root directory of your project run the command:

```
composer update

```

Note: this is optional step. You can also publish package's config and view files into you app

```
$ php artisan vendor:publish --provider="ThaiLe\MetronicDatatable\MetronicDatatableServiceProvider"

```

Usage
=====

[](#usage)

In your controller, you can define the table with columns and actions as follow

```
public function index(Request $request)
{
    $table = [
        'title' => 'News Overview',
        'id' => 'news-datatable',
        'ajax' => [
            'src' => 'news.more', // route name
        ],
        'columns' => [
            'title' => [
                'text' => 'Title',
                'orderable' => true,
            ],
            // ...
        ],
        'actions' => [
            'show'    => [
                'route' => 'news.show', // route name
                'role' => 'news.read',
            ],
            // ...
        ],

        // ...
    ];

    return view('news.list', [
        'table' => $table,
    ]);
}

// get data via ajax
public function more(Request $request)
{
    $news = News::paginate(15);
    $total = $news->total();

    return json_encode([
        'data'            => $news->getCollection()->toArray(),
        'recordsTotal'    => $total,
        'recordsFiltered' => $total,
    ]);
}

```

Then, in your view, just include the table

```
@include('metronic-datatable::list')

```

Don't forget to define related routes.

Configuration
=============

[](#configuration)

Table configuration
-------------------

[](#table-configuration)

```
$table = [
    'title' => 'News Overview',

    // allow to filter items by their status (pending, publish)
    // this option will display [All | Trashed] bar in top of the table
    'filter_navigation' => true,

    // allow to display checkboxes in the table
    'checkbox_column' => true,

    // set default sort column for the table
    'order_default' => [
        'column' => 'available_date_only',
        'order' => 'desc', // or 'asc'
    ],
];

```

Column configuration
--------------------

[](#column-configuration)

- This is possible configuration for specific column

```
$table = [
    'title' => 'News Overview',
    'id' => 'news-datatable',
    'ajax' => [
        'src' => 'news.more', // route name
    ],
    'columns' => [
        'title' => [
            'text' => 'Title',
            'orderable' => true,      // allow sort on this column
            'width' => 10%,           // set the width of this column
            'class' => 'td-text-left' // set the column classes

            // you can also display pre-formatted html in a column
            // for example: display status check or un-check icon
            'html' => '',
            // or display an image
            // 'html' => '',
        ],
        // ...
    ],
    // ...
];

```

- Allow filter on specific column. Currently, the system just allow filter for these types: input, select dropdown, date time pickers.

```
$table = [
    'title' => 'News Overview',
    'id' => 'news-datatable',
    'ajax' => [
        'src' => 'news.more', // route name
    ],
    'columns' => [
        'title' => [
            'text' => 'Title',

            // input filter
            'filter' => [
                'type' => 'input',
            ],
        ],

        'categories' => [
            'text' => 'Categories',

            // select dropdown filter
            'filter' => [
                'type' => 'select',
                'data' => $categories, // this data is queried from db or is fetched in another sources
            ],
        ],

        'available_date_only' => [
            'text'   => 'Date and time',

            // date time filter
            'filter' => [
                'type' => 'date',

                // you also can set the date time format here
                // for example: if current language is Germany, they will have the date time format like: d/m/Y H:i
                'format' => 'd/m/Y H:i',
            ],
        ],
        // ...
    ],
    // ...
];

```

- Action column configuration. Currently, the system just supports these button types: show, edit, trash, restore, delete, unblock IP address, assign role.

```
$table = [
    'title' => 'News Overview',
    // ...

    'actions' => [
        'add'    => [
            'name'  => 'Add new',     // button text
            'route' => 'news.show',   // route name
        ],
        // ...
    ],
];

```

Bulk action configuration
-------------------------

[](#bulk-action-configuration)

You can config bulk actions (i.e: bulk trash, bulk restore, bulk delete) for specific table as follow

```
public function index(Request $request)
{
    $table = [
        'title' => 'News Overview',
        // ...

        'bulk_actions' => [
            [
                'name'   => 'bulk_trash',
                'text'   => 'Bulk trash items',
                'route'  => 'news.bulk_trash', // route name
                'method' => 'post'
            ],
            [
                'name'   => 'bulk_restore',
                'text'   => 'Bulk restore items',
                'route'  => 'news.bulk_restore', // route name
                'method' => 'post'
            ],
            [
                'name'   => 'bulk_delete',
                'text'   => 'Bulk delete items',
                'route'  => 'news.bulk_delete', // route name
                'method' => 'post'
            ],
        ],
    ];

    return view('news.list', [
        'table' => $table,
    ]);
}

```

Change log
==========

[](#change-log)

- Fix checkbox indeterminate issue after upgrading to the Metronic 5

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a578447ea9346b2612f7978d196dc3e84ef7322dff373306c5955d61365c72f?d=identicon)[thaile.dev](/maintainers/thaile.dev)

---

Top Contributors

[![thaile0101](https://avatars.githubusercontent.com/u/45391541?v=4)](https://github.com/thaile0101 "thaile0101 (1 commits)")

### Embed Badge

![Health badge](/badges/thaile-metronic-datatable/health.svg)

```
[![Health](https://phpackages.com/badges/thaile-metronic-datatable/health.svg)](https://phpackages.com/packages/thaile-metronic-datatable)
```

###  Alternatives

[jeroennoten/laravel-adminlte

Easy AdminLTE integration with Laravel

4.0k4.8M43](/packages/jeroennoten-laravel-adminlte)[dmstr/yii2-adminlte-asset

AdminLTE backend theme asset bundle for Yii 2.0 Framework

1.1k1.8M67](/packages/dmstr-yii2-adminlte-asset)[dwij/laraadmin

LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like CRUD Generation, Module Manager, Media, Menus, Backups and much more

1.6k68.7k](/packages/dwij-laraadmin)[filament/spatie-laravel-media-library-plugin

Filament support for `spatie/laravel-medialibrary`.

1764.8M125](/packages/filament-spatie-laravel-media-library-plugin)[bezhansalleh/filament-exceptions

A Simple &amp; Beautiful Pluggable Exception Viewer for FilamentPHP's Admin Panel

193195.9k13](/packages/bezhansalleh-filament-exceptions)[filament/infolists

Easily add beautiful read-only infolists to any Livewire component.

1220.8M36](/packages/filament-infolists)

PHPackages © 2026

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