ginkelsoft / datatables
A simple DataTable package for Laravel
Requires
- php: >=8.2
- illuminate/support: ^10.0|^11.0|^12.0
- livewire/livewire: ^3.0
- dev-develop
- 0.0.10
- 0.0.9
- 0.0.8
- 0.0.7
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-feature/filter-date-between
- dev-feature/laravel-pint
- dev-feature/added-config
- dev-feature/update-readme-v009
- dev-feature/update-filters-and-style
- dev-ginkelsoft-development-patch-1
- dev-feature/url-support-for-actions
- dev-feature/update-readme
- dev-bugfix/bulk-action-when-is-empty
- dev-bugfix/mobile-version
- dev-bugfix/pagination-remove-arg-from-url
- dev-feature/add-filters-language-make-views-clean
- dev-feature/make-actions-flexible-and-customizable
- dev-bugfix/all-kind-of-fixes
- dev-bugfix/toggle-row-selection
- dev-feature/readme-file
This package is not auto-updated.
Last update: 2025-07-01 11:08:26 UTC
README
Ginkelsoft DataTables is a flexible and easy-to-use package for managing tabular data in Laravel projects. This package requires Livewire for dynamic, AJAX-driven experiences. You can easily add filtering, searching, sorting, and bulk actions with minimal setup.
Documentation
The official documentation is now available at:
Table of Contents
- Requirements
- Installation
- Usage With Livewire
- Filters
- Sorting
- Row Actions & Bulk Actions
- Additional Features
- Contributing
- License
Requirements
- PHP 8.2+
- Laravel 10.0+
- Livewire (Required for usage of this package.)
Installation
-
Require the package:
composer require ginkelsoft/datatables
-
Publish the package views (optional) for customization:
php artisan vendor:publish --provider="Ginkelsoft\DataTables\DataTableServiceProvider" --tag=views
-
Publish configuration file (optional) for customization:
php artisan vendor:publish --provider="Ginkelsoft\DataTables\DataTableServiceProvider" --tag=config
Usage With Livewire
This package requires Livewire and cannot be used without it. To integrate DataTables in your Laravel project, use the following setup:
<livewire:datatable model="App\\Models\\User" :columns="['id', 'name', 'email', 'created_at']" :hidden-columns="['id']" :filters="[ ['column' => 'name', 'type' => 'input', 'label' => 'Naam'], ['column' => 'email', 'type' => 'input', 'label' => 'Email'], ['column' => 'created_at', 'type' => 'date', 'label' => 'Aangemaakt op'] ]" :row-actions="[ ['name' => 'edit', 'label' => 'Edit', 'route' => 'users.datatable.edit'], ['name' => 'delete', 'label' => 'Delete', 'route' => 'users.datatable.delete'], ['name' => 'view', 'label' => 'View Profile', 'url' => '/users/{id}'] ]" :bulk-actions="[ 'export' => ['label' => 'Export', 'route' => 'users.datatable.export'] ]" />
Filters
You can define various filters for refining results dynamically.
:filters="[ ['column' => 'name', 'type' => 'input', 'label' => 'Naam'], ['column' => 'email', 'type' => 'input', 'label' => 'Email'], ['column' => 'created_at', 'type' => 'date', 'label' => 'Aangemaakt op'] ]"
Sorting
Sorting is enabled by default. Clickable column headers allow users to sort the data in ascending or descending order.
By default, sorting is applied to the first column in the :columns
array. If needed, sorting can be applied programmatically by setting:
:sort-column="'created_at'" :sort-direction="'desc'"
Row Actions & Bulk Actions
Row Actions
:row-actions="[ ['label' => 'Edit', 'route' => 'users.edit'], ['label' => 'Delete', 'url' => 'users/{id}', 'onclick' => 'return confirm(\'Are you sure?\')'] ]"
Bulk Actions
:bulk-actions="[ 'delete' => ['label' => 'Delete', 'route' => 'users.bulk.delete'], 'export' => ['label' => 'Export', 'route' => 'users.bulk.export'] ]"
Additional Features
- Multi-language Support: English, Dutch, German, French, Spanish.
- Search Class for multi-column searching.
- Filter Class for custom filters (status, categories, etc.).
- Sorting Class for ascending/descending ordering.
- Select All (with confirmation modal) to choose between only visible rows or all rows.
- Custom Actions now support classes and inline styles.
- Prevent row selection when clicking an action button to avoid accidental selection.
Contributing
- Fork this repository.
- Create a new branch for your feature or fix.
- Push your changes and open a pull request.
We welcome improvements to code quality, new features, or better documentation.
License
Ginkelsoft DataTables is open-sourced software licensed under the MIT license.
Version Changes
Changes in version 0.0.10:
actions
have been renamed torow-actions
.- A new configuration file has been added.
- Ensure the Livewire component is updated, otherwise, it will not work correctly.
- Official documentation site launched: https://datatables.ginkelsoft.com/