Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laravel-admin-extensions/data-table
data table for laravel-admin
https://github.com/laravel-admin-extensions/data-table
Last synced: about 1 month ago
JSON representation
data table for laravel-admin
- Host: GitHub
- URL: https://github.com/laravel-admin-extensions/data-table
- Owner: laravel-admin-extensions
- License: mit
- Created: 2019-03-29T14:41:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-06T01:29:54.000Z (over 3 years ago)
- Last Synced: 2024-11-02T19:33:50.417Z (about 1 month ago)
- Language: PHP
- Size: 986 KB
- Stars: 32
- Watchers: 2
- Forks: 15
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-laravel-admin - data-table - Data-table 前端组件 (扩展包 / 组件类扩展包)
README
# DataTable for laravel-admin
**Add advanced interaction controls to your HTML tables** the free & easy way.
[![996.icu](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu)
## ScreenShot
## Install
```bash
composer require jxlwqq/data-table
php artisan vendor:publish --tag=laravel-admin-data-table
```## Update
```bash
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:
```php
'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](https://github.com/DataTables/Plugins/tree/master/i18n).
## Use
```php
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](https://datatables.net/reference/option/).
## More resources
[Awesome Laravel-admin](https://github.com/jxlwqq/awesome-laravel-admin)
## License
Licensed under [The MIT License (MIT)](LICENSE).