> For the complete documentation index, see [llms.txt](https://queents.gitbook.io/vilt/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://queents.gitbook.io/vilt/builders/table.md).

# Table

our framework has a class for table use to set filters for the table and add a row based actions

### Filters

<figure><img src="/files/53YQnEYqDb1kOJuc7DvU" alt=""><figcaption></figcaption></figure>

to add a new filter to the table you need to use some methods on the `table()` method to add

```php
public function table(): Table
{
    return Table::make('table')->filters([
        Filter::make('customer_group_id')->rows([
            HasOne::make('customer_group_id')->relation('customersGroup')->validation("required|array")->label(__('Customer Group'))->model(\Modules\Customers\Entities\CustomersGroup::class),
        ])
    ]);
}
```

**NOTE**

> The Filter class take only 1 row the name of this row must be the same name of the filter make method

that's for the frontend for the backend query on your Resource class use this method like

```php
public function setFilters($query, Request $request): void {
    if($request->has('customer_group_id')){
        $query->where('customer_group_id', $request->get('customer_group_id'));
    }
}
```

### Actions

<figure><img src="/files/gQaSfBUinRMUHjdl523o" alt=""><figcaption></figcaption></figure>

to add a new action on the row you need to use `->actions()` method on the `Table::class` method like

```php
public function table(){
    return Table::make('table')->actions([
        Action::make('password')->type('main')->label(__('Password'))->icon('bx bx-lock')->modal('password'),
    ]);
}
```
