Laravel Livewire Tables Documentation

🎉 Enjoying this package? Consider sponsoring me on GitHub or buying me a beer.

This is the documentation for v1 but the latest version is v3. You can switch versions in the menu at the top. Check your current version with the following command:

composer show rappasoft/laravel-livewire-tables

Conditional columns

If you would like to show/hide columns based on a conditional, you may use the hideIf method on the Column builder:

1Column::make('Special Field')
2 ->hideIf(! auth()->user()->isAdmin());

Note: This only works for the corresponding cells if using the column builder to also build the rest of the table.

When using 'rowView' to render your cells:

Since rowView does not keep track of the column loop, you must also wrap the same conditional around the cells when using this method:

1@if (! auth()->user()->isAdmin())
2 <x-livewire-tables::table.cell>
3 {{ $row->special_field ?? 'N/A' }}
4 </x-livewire-tables::table.cell>
5@endif