- Creating Columns
- Relationships
- Available Methods
- Other Column Types
- Column Selection
- Secondary Header
- Footer
- Reusable Columns
- Anonymous Columns
- Styling
- Standard Column
- Array Columns (beta)
- Avg Columns (beta)
- Boolean Columns
- Button Group Columns
- Color Columns
- Component Columns
- Count Columns (beta)
- Date Columns
- Icon Columns (beta)
- Image Columns
- Increment Column (beta)
- Link Columns
- Livewire Component (beta)
- Sum Columns (beta)
- View Component Columns
- Wire Link Column (beta)
- Introduction
- Creating Filters
- Applying Filters
- Available Methods
- Available Component Methods
- Available Filter Methods
- Introduction
- Boolean Filters (beta)
- Date Filters
- DateRange Filters
- DateTime Filters
- Multi-Select Dropdown Filters
- Multi-Select Filters
- NumberRange Filters
- Number Filters
- Select Filters
- Text Filters
- Livewire Custom Filter (Beta)
- Refreshing
- Loading Placeholder
- Multiple Tables Same Page
- Actions (beta)
- Adding Custom Markup
- Debugging
- Saving Table State
- Lifecycle Hooks
- Hiding The Table (beta)
- One Of Many Example
- Tools
Getting Started
Usage
DataTable
Columns
Column Types
Rows
Sorting
Pagination
Search
Bulk Actions
Filters
Filter Types
Reordering
Secondary Header
Footer
Examples
Misc.
Sponsored
Advanced Usage
Examples
🎉 Enjoying this package? Consider sponsoring me on GitHub or buying me a beer.
This is the documentation for v3. You can switch versions in the menu on the left/at the top. Check your current version with the following command:
composer show rappasoft/laravel-livewire-tables
Configuration
Publishing Assets
Publishing assets are optional unless you want to customize this package.
Note: I don't recommend you publishing the views unless you really need to change them, and if so, only keep the ones you are changing. Let the package display the rest. The views change quite often and you will miss out on new features or have unforeseeable issues.
1php artisan vendor:publish --provider="Rappasoft\LaravelLivewireTables\LaravelLivewireTablesServiceProvider" --tag=livewire-tables-config2 3php artisan vendor:publish --provider="Rappasoft\LaravelLivewireTables\LaravelLivewireTablesServiceProvider" --tag=livewire-tables-views4 5php artisan vendor:publish --provider="Rappasoft\LaravelLivewireTables\LaravelLivewireTablesServiceProvider" --tag=livewire-tables-translations6 7php artisan vendor:publish --provider="Rappasoft\LaravelLivewireTables\LaravelLivewireTablesServiceProvider" --tag=livewire-tables-public
The default frontend framework is Tailwind, but you also have the option to use Bootstrap 4 or Bootstrap 5 by specifying in the config file.
This is the contents of the published config file:
1<?php2 3return [4 /**5 * Options: tailwind | bootstrap-4 | bootstrap-5.6 */7 'theme' => 'tailwind',8];
Tailwind Purge
If you find that Tailwind's CSS purge is removing styles that are needed, you have to tell Tailwind to look for the table styles so it knows not to purge them.
In your tailwind.config.js configuration:
1// V2 2module.exports = { 3 mode: 'jit', 4 purge: [ 5 ... 6 './vendor/rappasoft/laravel-livewire-tables/resources/views/**/*.blade.php', 7 ], 8 ... 9};10 11// V312module.exports = {13 content: [14 ...15 './vendor/rappasoft/laravel-livewire-tables/resources/views/**/*.blade.php',16 ],17 ...18};
Tailwind Dark Mode
If you find that the table is consistently displaying in Dark Mode, then you will need to add the following into your tailwind.config.js configuration, keeping in mind that this could impact other components using dark mode!
1module.exports = {2 darkMode: 'class', // This specifies that Tailwind should look at Class elements to determine dark mode3...4};
Alpine.js Cloak
You must also make sure you have this Alpine style available globally. Note that this is configured by default by Livewire after 3.x
1<style>2 [x-cloak] { display: none !important; }3</style>
Bypassing Laravel's Auth Service
By default, all events will retrieve any currently authenticated user from Laravel's Auth service and pass it along with the event.
If your project doesn't include the Illuminate/Auth package, or you otherwise want to prevent this, you can set the enableUserForEvent
config option to false.
1// config/livewire-tables.php 2return [ 3 // ... 4 'events' => [ 5 /** 6 * Enable or disable passing the user from Laravel's Auth service to events 7 */ 8 'enableUserForEvent' => false, 9 ],10];