Download the PHP package modus-digital/livewire-datatables without Composer
On this page you can find all versions of the php package modus-digital/livewire-datatables. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download modus-digital/livewire-datatables
More information about modus-digital/livewire-datatables
Files in modus-digital/livewire-datatables
Package livewire-datatables
Short Description Reusable Laravel Livewire datatable for the TALL stackโTailwind-styled, concern-driven (columns, filters, sorting, pagination, row actions), fully testable with Pest & Larastan-ready.
License MIT
Homepage https://github.com/modus-digital/livewire-datatables
Informations about the package livewire-datatables
Livewire Datatables
A modern, feature-rich Livewire Datatable component for the TALL stack (Tailwind CSS, Alpine.js, Laravel, Livewire). Built with modularity, performance, and developer experience in mind.
โจ Features
- ๐จ Beautiful Tailwind CSS styling with dark mode support
- ๐ Global search with debounced input and relationship support
- ๐๏ธ Advanced filtering with multiple filter types (Text, Select, Date)
- ๐ Column sorting with visual indicators and custom sort fields
- ๐ Pagination with customizable page sizes and navigation
- โ Row selection with bulk actions and "select all" functionality
- ๐ฏ Row actions with customizable buttons and callbacks
- ๐ผ๏ธ Multiple column types (Text, Icon, Image) with specialized features
- ๐ท๏ธ Badge support with dynamic colors and callbacks
- ๐ Clickable rows with custom handlers
- ๐ญ Custom cell views for complex content rendering
- ๐ Performance optimized with efficient querying
๐ Requirements
| Requirement | Version |
|---|---|
| PHP | ^8.3 |
| Laravel | ^11.0 or ^12.0 |
| Livewire | ^3.0 |
| Tailwind CSS | ^4.0 |
| Alpine.js | ^3.0 |
๐ฆ Installation
Install the package via Composer:
The package will automatically register its service provider.
Publishing Views (Optional)
To customize the table appearance, publish the views:
This publishes all Blade templates to resources/views/vendor/livewire-datatables/.
Publishing Config (Optional)
To customize the package, you can publish the config file:
This publishes a config file to config/livewire-datatables.php
Source frontend styles
To automatically source the frontend using tailwind, include the following files to the app.css
๐ Quick Start
1. Generate a Table Component
Use the built-in Artisan command to scaffold a new table:
Or create one manually:
2. Use in Your Blade Template
๐ Documentation
Column Types
Base Column
De basis met alle kernopties:
TextColumn
Extraโs voor tekstweergave:
IconColumn
ImageColumn
Relatievelden gebruik je met dot-notatie in field:
Voor aangepaste SQL sortering via een andere kolom:
Filters
TextFilter
SelectFilter
DateFilter
Filters werken ook op relatievelden (field('relation.attribute')). Indien een veld een Eloquent attribute/accessor is, valt filtering terug op PHP (na ophalen) voor correcte resultaten.
Row selection
Rijselectie inschakelen en gebruiken:
Geselecteerde IDs vind je in $this->selected (array). Combineer dit met een globale actie om bulk-operaties te doen (zie hieronder).
Row Actions
Voeg rijacties met callbacks toe:
Je kunt zichtbaarheid conditioneel maken met ->visible(fn ($row) => ...) en een ->icon() string meegeven.
Global Actions
Header-acties met callback (handig voor bulk op $this->selected):
Clickable Rows
Maak hele rijen klikbaar door showRecord te overriden:
Pagination Configuration
Search Configuration
Empty State Customization
Publiceer de views en pas resources/views/vendor/livewire-datatables/partials/empty-state.blade.php aan:
Custom Query Building
Relationship Handling
Gebruik dotโnotatie in field('relation.column'). Voor sorting over relaties gebruik je ->sortField('related_table.column'). Wanneer je sorteert op een attribute/accessor, wordt automatisch in PHP gesorteerd na ophalen.
๐จ Styling & Customization
Dark Mode Support
The package includes full dark mode support using Tailwind's dark: variants. Ensure your project has dark mode configured:
Custom Views
Create custom cell views for complex content:
Badge Colors
Available badge colors for TextColumn:
gray(default)redyellowgreenblueindigopurplepink
๐๏ธ Architecture
The package follows a modular trait-based architecture:
Core Traits
HasColumns- Column management and rendering (120 lines)HasFilters- Filter functionality and application (149 lines)HasPagination- Pagination configuration (67 lines)HasSorting- Sorting logic and state management (132 lines)HasRowSelection- Row selection and bulk actions (142 lines)HasRowActions- Individual row action handling (92 lines)HasActions- Global header actions (59 lines)
Each trait is focused, testable, and can be understood independently.
๐งช Testing
The package includes comprehensive tests using Pest 3:
๐ง Development
Code Quality Tools
The package uses several tools to maintain high code quality:
- Pest 3 - Modern PHP testing framework
- Larastan - Static analysis for Laravel
- Laravel Pint - Code style fixer
- PHPStan - Static analysis with strict rules
Contributing Workflow
- Fork the repository
- Create a feature branch
- Write tests for new functionality
- Ensure all tests pass:
composer test - Fix code style:
composer format - Run static analysis:
composer analyse - Submit a pull request
๐ Changelog
See CHANGELOG.md for recent changes and version history.
๐ฅ Credits
- Alex van Steenhoven - Creator & Maintainer
- Modus Digital - Organization
- All Contributors
๐ License
The MIT License (MIT). Please see License File for more information.