Weave Code
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 Tables Laravel Package

lunarphp/livewire-tables

Livewire tables for Lunar PHP apps. Build sortable, searchable, paginated data tables with reusable components and Lunar-friendly defaults. Integrates cleanly with Laravel and Livewire to speed up admin/listing UIs.

View on GitHub
Deep Wiki
Context7

Getting Started

Start by installing the package via Composer (composer require lunarphp/livewire-tables), then publish its config and stubs using php artisan vendor:publish --tag=livewire-tables-config. Create your first table class by extending LunarPHP\LivewireTables\Table, define columns in the columns() method (e.g., Column::make('Name', 'name')), and attach the @livewire('table') directive in a Blade view. For quick wins, scaffold a table for an existing model (e.g., User) using php artisan make:table UserTable, then wire it up by returning a query (e.g., User::query()) from the query() method.

Implementation Patterns

Use Column::text(), Column::boolean(), and Column::select() for common render types—cells can be customized via closures or custom view components. Leverage filter() to define reactive filters (text, select, date) and sort() to declare sortable columns; Livewire handles state and reactivity automatically. For bulk actions, implement bulkActions() to return an array of Action objects, each tied to a call method in the table class. To keep logic clean, separate concerns: columns() for UI, query() for data fetching, and actions()/bulkActions() for business logic. Keep state minimal—rely on Livewire’s built-in reactivity instead of storing large arrays.

Gotchas and Tips

  • The package assumes column names match database fields unless aliased—use Column::make('Display', 'custom_column_name') for mismatches.
  • Filtering on relationships requires explicit whereHas() logic in your query() method (e.g., $query->whereHas('role', fn($q) => $q->where('name', $value))).
  • Pagination uses simplePaginate() under the hood; if you need full pagination (with total count), override usePagination().
  • Custom filters must be registered with matching filter() method names and handled in applyFilters() if overriding default behavior.
  • The last release is from 2022—verify compatibility with newer Livewire (v3) and Laravel versions before adoption; consider checking community forks or contributing fixes if maintenance is stale.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport