- 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
- Link Columns
- Livewire Component (beta)
- Sum Columns (beta)
- View Component Columns
- Wire Link Column (beta)
- 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
Recommended
While the package is very customisable, and supports a number of different approaches. The below is the recommended approach, that gives the best performance for the tables:
Installation
1composer require rappasoft/laravel-livewire-tables
Publish the Tables Config
1php artisan vendor:publish --tag="livewire-tables-config"
Livewire Tables Config Updates
Update the published Livewire Tables Config (config/livewire-tables.php) and set the following to false:
1/** 2 * Cache Rappasoft Frontend Assets 3 */ 4'cache_assets' => false, 5 6/** 7 * Enable or Disable automatic injection of core assets 8 */ 9'inject_core_assets_enabled' => false,10 11/**12 * Enable or Disable automatic injection of third-party assets13 */14'inject_third_party_assets_enabled' => false,15 16/**17 * Enable Blade Directives (Not required if automatically injecting or using bundler approaches)18 */19'enable_blade_directives' => false,
Bundling the Assets
As you have now told the package not to inject the assets, add the following to your resources/js/app.js file:
1import '../../vendor/rappasoft/laravel-livewire-tables/resources/imports/laravel-livewire-tables-all.js';
Update Layouts
Ensure that your layouts do not reference any of the following blade directives, as these are not required with the above approach
1<!-- Adds the Core Table Styles --> 2@rappasoftTableStyles 3 4<!-- Adds any relevant Third-Party Styles (Used for DateRangeFilter (Flatpickr) and NumberRangeFilter) --> 5@rappasoftTableThirdPartyStyles 6 7<!-- Adds the Core Table Scripts --> 8@rappasoftTableScripts 910<!-- Adds any relevant Third-Party Scripts (e.g. Flatpickr) -->11@rappasoftTableThirdPartyScripts
Tailwind Specific
If using Tailwind, you should update your tailwind.config.js file, adding the following to the "content" section under module.exports. This ensures that the Livewire Tables specific core classes are included.
1'./vendor/rappasoft/laravel-livewire-tables/resources/views/*.blade.php',2'./vendor/rappasoft/laravel-livewire-tables/resources/views/**/*.blade.php',
It is also recommended to add the paths to any Livewire Tables components, for example:
1'./app/Livewire/*.php',2'./app/Livewire/**/*.php',
So that any classes used in setTdAttributes or similar are included!
Run your build process
1npm run build
Clear Cached Views
1php artisan view:clear
You may of course run view:cache at this point.