Introducing Laravel Quizzes! Play now

Laravel Livewire Tables Documentation

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

composer show rappasoft/laravel-livewire-tables

Available Methods

Component Methods

These are the available filters configuration methods on the component.


Filters are enabled by default but will only show up if you have at least one defined.

setFiltersStatus

Enable/disable filters for the whole component.

public function configure(): void
{
    $this->setFiltersStatus(true);
    $this->setFiltersStatus(false);
}

setFiltersEnabled

Enable filters for the component.

public function configure(): void
{
    // Shorthand for $this->setFiltersStatus(true)
    $this->setFiltersEnabled();
}

setFiltersDisabled

Disable filters for the component.

public function configure(): void
{
    // Shorthand for $this->setFiltersStatus(false)
    $this->setFiltersDisabled();
}

setFiltersVisibilityStatus

Enabled by default, show/hide the filters dropdown.

public function configure(): void
{
    $this->setFiltersVisibilityStatus(true);
    $this->setFiltersVisibilityStatus(false);
}

setFiltersVisibilityEnabled

Show the filters dropdown for the component.

public function configure(): void
{
    // Shorthand for $this->setFiltersVisibilityStatus(true)
    $this->setFiltersVisibilityEnabled();
}

setFiltersVisibilityDisabled

Hide the filters dropdown for the component.

public function configure(): void
{
    // Shorthand for $this->setFiltersVisibilityStatus(false)
    $this->setFiltersVisibilityDisabled();
}

setFilterPillsStatus

Enabled by default, show/hide the filter pills.

public function configure(): void
{
    $this->setFilterPillsStatus(true);
    $this->setFilterPillsStatus(false);
}

setFilterPillsEnabled

Show the filter pills for the component.

public function configure(): void
{
    // Shorthand for $this->setFilterPillsStatus(true)
    $this->setFilterPillsEnabled();
}

setFilterPillsDisabled

Hide the filter pills for the component.

public function configure(): void
{
    // Shorthand for $this->setFilterPillsStatus(false)
    $this->setFilterPillsDisabled();
}

setFilterLayout

Set the filter layout for the component.

public function configure(): void
{
    $this->setFilterLayout('slide-down');
}

setFilterLayoutPopover

Set the filter layout to popover.

public function configure(): void
{
    $this->setFilterLayoutPopover();
}

Set the filter layout to slide down.

setFilterLayoutSlideDown

public function configure(): void
{
    $this->setFilterLayoutSlideDown();
}

setFilterSlideDownDefaultStatusEnabled

Set the filter slide down to visible by default

public function configure(): void
{
    // Shorthand for $this->setFilterSlideDownDefaultStatus(true)
    $this->setFilterSlideDownDefaultStatusEnabled();
}

setFilterSlideDownDefaultStatusDisabled

Set the filter slide down to collapsed by default

public function configure(): void
{
    // Shorthand for $this->setFilterSlideDownDefaultStatus(false)
    $this->setFilterSlideDownDefaultStatusDisabled();
}

Filter Methods

The following methods are available on the filter object.


setFilterPillTitle

By default, the filter pill title is the filter name, but you can make it whatever you want:

SelectFilter::make('Active')
    ->setFilterPillTitle('User Status')

setFilterPillValues

If you have numeric, or generated keys as your filter option values, they probably don't look too nice in the filter pill. You can set the values to be displayed in the filter pill:

SelectFilter::make('Active')
    ->setFilterPillTitle('User Status')
    ->setFilterPillValues([
        '1' => 'Active',
        '0' => 'Inactive',
    ])
    ->options([
        '' => 'All',
        '1' => 'Yes',
        '0' => 'No',
    ])

Now instead of Active: Yes it will say User Status: Active

hiddenFromMenus

Hide the filter from both the filter popover and the filter slide down.

SelectFilter::make('Active')
    ->hiddenFromMenus()

hiddenFromPills

Hide the filter from the filter pills when applied.

SelectFilter::make('Active')
    ->hiddenFromPills()

hiddenFromFilterCount

Hide the filter from the filter count when applied.

SelectFilter::make('Active')
    ->hiddenFromFilterCount()

hiddenFromAll

Hide the filter from the menus, pills, and count.

SelectFilter::make('Active')
    ->hiddenFromAll()

notResetByClearButton

By default the clear button will reset all filters to their defaults. You can prevent this on a specific filter by using this method.

SelectFilter::make('Active')
    ->notResetByClearButton()

Config

If the filter takes any config options, you can set them with the config method:

 DateFilter::make('Date')
    ->config([
        'min' => '2020-01-01',
        'max' => '2021-12-31',
    ])