fajarsulaksono / chumptable
This is a Laravel package for the server and client side of datatables at http://datatables.net/
Requires
- php: ^8.0
- illuminate/config: ^9.0|^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^9.0|^10.0|^11.0|^12.0|^13.0
- illuminate/view: ^9.0|^10.0|^11.0|^12.0|^13.0
Requires (Dev)
- laravel/pint: ^1.24
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.5
This package is auto-updated.
Last update: 2026-08-05 02:48:57 UTC
README
Chumptable (Laravel DataTable Fork)
Chumptable is a Laravel package that simplifies building server-side and client-side DataTables (http://datatables.net/).
Overview
This project is a maintained fork of Chumper/Datatable, updated to support PHP 8.0+ and recent Laravel versions.
Requirements
- PHP 8.0+
- Laravel 9, 10, 11, 12 or 13 (see
composer.json)
Installation
Install via Composer:
composer require fajarsulaksono/chumptable
Laravel package discovery will register the service provider and alias automatically. To publish the package configuration (optional):
php artisan vendor:publish --provider="Chumptable\\Datatable\\DatatableServiceProvider" --tag=config
Main features
- Engines for different data sources: Query (Eloquent/QueryBuilder) and Collection.
- Column helpers:
TextColumn,DateColumn,FunctionColumn. - View templates for table HTML and DataTables script; templates are overrideable via configuration.
- Facade
Datatablefor convenient usage in controllers and routes.
Available components
- Engines:
QueryEngine,CollectionEngine,BaseEngine. - Columns:
TextColumn,DateColumn,FunctionColumn. - Service provider:
DatatableServiceProvider(bindsdatatableinto the container).
Quick usage examples
- From a query (server-side / Eloquent / QueryBuilder):
use Datatable; // facade alias $response = Datatable::of($query) ->showColumns('id', 'name', 'email') ->searchColumns('name', 'email') ->make(); // returns a JSON response for DataTables
- From a collection (client-side):
use Datatable; $response = Datatable::collection($collection) ->showColumns('id', 'title') ->make();
- Generate table HTML + script using the
table()helper:
use Datatable; $tableHtml = Datatable::table() ->addColumn('Name', 'Email') ->setUrl(route('my.datatable.route')) ->render(); // then place $tableHtml into your view
Configuration & views
Default configuration and bundled views can be published and customized. The package configuration publishes to config/chumptable.php. View templates are provided by the package and can be overridden in your application's view namespace.
Contributing & testing
Unit tests use orchestra/testbench and phpunit (see composer.json). To run tests locally:
composer install --dev ./vendor/bin/phpunit
License
This package is licensed under the MIT license. See composer.json for details.