LaravelPackages.net
Acme Inc.
Toggle sidebar
jxlwqq/data-table

dataTable for laravel-admin

57.323
32
1.0.4
About jxlwqq/data-table

jxlwqq/data-table is a Laravel package for datatable for laravel-admin. It currently has 32 GitHub stars and 57.323 downloads on Packagist (latest version 1.0.4). Install it with composer require jxlwqq/data-table. Discover more Laravel packages by jxlwqq or browse all Laravel packages to compare alternatives.

Last updated

DataTable for laravel-admin

Add advanced interaction controls to your HTML tables the free & easy way.

996.icu

ScreenShot

Install

composer require jxlwqq/data-table
php artisan vendor:publish --tag=laravel-admin-data-table

Update

composer require jxlwqq/data-table
php artisan vendor:publish --tag=laravel-admin-data-table --force

Configurations

Add extensions option in your config/admin.php configuration file:

'extensions' => [
    'data-table' => [
        // If the value is set to false, this extension will be disabled
        'enable' => true,
        // global options
        'options' => [
             'paging' => false,
             'lengthChange' => false,
             'searching' => false,
             'ordering' => false,
             'info' => false,
             'language' => 'English', // or Chinese
        ]
    ]
]

More languages can be found in DataTable i18n.

Use

use Jxlwqq\DataTable\DataTable;

// table
$headers = ['Id', 'Email', 'Name', 'Company'];
$rows = [
    [1, '[email protected]', 'Ms. Clotilde Gibson', 'Goodwin-Watsica'],
    [2, '[email protected]', 'Allie Kuhic', 'Murphy, Koepp and Morar'],
    [3, '[email protected]', 'Prof. Drew Heller', 'Kihn LLC'],
    [4, '[email protected]', 'William Koss', 'Becker-Raynor'],
    [5, '[email protected]', 'Ms. Antonietta Kozey Jr.', 'Goooogle'],
];

$style = ['table-bordered','table-hover', 'table-striped'];

$options = [
    'paging' => true,
    'lengthChange' => false,
    'searching' => false,
    'ordering' => true,
    'info' => true,
    'autoWidth' => false,
];

$dataTable = new DataTable($headers, $rows, $style, $options);

echo $dataTable->render();

more options can be found in DataTable Documentation.

More resources

Awesome Laravel-admin

License

Licensed under The MIT License (MIT).

Star History Chart