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

Laravel Livewire Tables Laravel Package

alp-develop/laravel-livewire-tables

Reactive Livewire data tables for Laravel—search, sort, filter, paginate, export, and bulk actions with zero JavaScript. Supports Laravel 10–13, Livewire 3–4, PHP 8.1+, Tailwind or Bootstrap 4/5, plus dark mode and configurable themes.

View on GitHub
Deep Wiki
Context7

Toolbar Slots

Toolbar slots allow you to inject custom content into the table's toolbar area and around the table itself.

Available Slots

Method Position
toolbarLeftPrepend() Before search input (left side)
toolbarLeftAppend() After search & filter buttons (left side)
toolbarRightPrepend() Before bulk/columns/per-page (right side)
toolbarRightAppend() After per-page selector (right side)
beforeTable() After toolbar, before data rows
afterTable() After data rows, before pagination

Each method returns View|string|null. Return null (default) to render nothing.

Usage

Override the slot methods in your table component:

use Illuminate\Contracts\View\View;

class UsersTable extends DataTableComponent
{
    public function toolbarLeftPrepend(): View|string|null
    {
        return '<button wire:click="createUser" class="lt-btn-primary">+ New User</button>';
    }

    public function toolbarRightAppend(): View|string|null
    {
        return view('tables.partials.toolbar-actions');
    }

    public function beforeTable(): View|string|null
    {
        return '<div class="p-3 bg-yellow-50 text-yellow-800 rounded">⚠ 5 users pending approval</div>';
    }

    public function afterTable(): View|string|null
    {
        return view('tables.partials.summary', [
            'total' => $this->getSelectedCount($this->totalRows ?? 0),
        ]);
    }
}

Returning a View

public function toolbarLeftPrepend(): View|string|null
{
    return view('tables.partials.create-button', [
        'label' => 'New User',
        'action' => 'createUser',
    ]);
}
{{-- resources/views/tables/partials/create-button.blade.php --}}
<button wire:click="{{ $action }}" class="lt-btn-primary">
    {{ $label }}
</button>

Returning HTML String

public function toolbarRightPrepend(): View|string|null
{
    $count = User::where('active', false)->count();
    return "<span class='text-red-600 text-sm font-medium'>{$count} inactive</span>";
}

Conditional Slots

public function beforeTable(): View|string|null
{
    if (! $this->hasActiveFilters()) {
        return null;
    }

    return '<div class="p-2 text-sm text-gray-500">Filters are active. Showing filtered results.</div>';
}
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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui