Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Livewire Datatables

Livewire Datatables Laravel Package

mahmoud217tr/livewire-datatables

A Laravel Livewire package for building interactive data tables with sorting, searching, and pagination directly in your Blade views. Render dynamic tables from Eloquent models without leaving the Livewire component workflow, keeping server-side rendering simple and reactive.

View on GitHub
Deep Wiki
Context7

Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS

Frequently asked questions about Livewire Datatables
How do I install mahmoud217tr/livewire-datatables in a Laravel project?
Install it with Composer by running composer require mahmoud217tr/livewire-datatables in the root of your Laravel application. Because the package is a Livewire component library, you need Livewire already installed and configured, along with Tailwind CSS and Alpine.js on the front end. After installing, check the repository README for any publishable config or view stubs you may want to customise before rendering your first table.
Which Laravel and Livewire versions does this package support?
The package targets modern Laravel applications that run Livewire, since the table behaviour is driven entirely by Livewire components. The exact supported Laravel and Livewire version ranges are declared in the package's composer.json, so check that file or the README before adding it to an older or heavily customised application. If you are upgrading Livewire majors, run your test suite afterwards to confirm the table components still behave as expected.
Do I need Tailwind CSS and Alpine.js to use livewire-datatables?
Yes. The package is described as being built with Laravel, Livewire, Tailwind CSS and Alpine.js, so the default table markup and interactions assume Tailwind utility classes and Alpine directives are available. In a fresh Laravel app you would install Tailwind and Alpine through your usual Vite setup, and make sure the package's view paths are included in your Tailwind content configuration so the classes are not purged. If you use a different CSS framework, you will need to override the package views.
How do I render a datatable from an Eloquent model in a Blade view?
You typically define a Livewire component that exposes the model query and column configuration, then drop the corresponding Livewire tag into your Blade view. The component handles sorting, searching and pagination internally, so the Blade file stays mostly declarative rather than full of loop and query logic. Consult the README for the exact component name and property names used to pass the Eloquent query and columns.
Is searching and sorting handled on the server or in the browser?
It is handled on the server through Livewire requests, which is the main reason the package keeps working well with large tables. Each search term or sort change triggers a Livewire round trip that re-runs the query with the appropriate constraints and returns only the current page of results. That means you avoid shipping your entire dataset to the browser just to filter it, and behaviour stays consistent with your database collation and query logic.
Can I customise columns and render custom markup instead of raw values?
Yes. You define which model attributes appear as columns and can render a column with your own Blade markup so badges, links, formatted dates or action buttons appear instead of plain values. This keeps presentation concerns in the view layer while the component handles the query, sorting and pagination. The README documents the supported column definition options, so check it before writing custom view overrides.
How does pagination work with large datasets?
Pagination is handled by Livewire, so only the current page of rows is fetched from the database for each request. You can usually control the number of rows per page through a component property, and the page state lives in the URL or component state depending on your configuration. For very large tables, make sure the columns you sort and search on are indexed, since every interaction re-runs the query.
How do I avoid N+1 queries when a table column uses a relationship?
Eager load the relationships in the query you hand to the datatable, using with() or a scoped query builder before passing it to the component. Because searching and sorting re-run the query per request, missing eager loads cause repeated queries for every row on every interaction. It is worth enabling query logging in local development to confirm the table renders with a constant number of queries.
How do I test a Livewire datatable component?
Use Livewire's testing helpers, such as Livewire::test on your table component, then assert the rendered output with assertSee and assertSet on the relevant public properties. You can simulate a search or sort by calling the component's public update methods and asserting that the expected rows appear or disappear. Since the heavy lifting is server side, these tests exercise the real query path, which makes them useful regression coverage for filtering logic.
Why use this package instead of building a table by hand or using a bigger admin kit?
It is a focused option when you want interactive tables inside a normal Livewire and Blade workflow without adopting a full admin panel framework. You get sorting, searching and pagination from Eloquent models with Tailwind and Alpine styling you can override, which suits applications that need tables in several places but not a whole CRUD suite. If you need exports, complex filters, column reordering or heavy theming out of the box, compare the README feature list against a larger package before committing. As with any smaller package, check recent commit activity and issue responsiveness to judge maintenance before relying on it in production.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections