awcodes / filament-table-repeater

A modified version of the Filament Forms Repeater to display it as a table.
MIT License
188 stars 42 forks source link

The documentation for the headers() method requires updating. #93

Closed phonicfrank closed 5 months ago

phonicfrank commented 6 months ago

Filament Version

v3

Plugin Version

v2.1

PHP Version

PHP 8.3

Problem description

I could never get the headers() method to function as expected, decided to look into the source code to figure out what's happening.

In reference to the documentation, the table headers can be modified by passing an array of the desired headers to the headers() method. For example:

TableRepeater::make('product') ->headers(['Product Name', 'Quantity'])

However, it should be noted that the correct syntax involves including the field name as the key otherwise TableRepeater will simply use the default label of the fields.

TableRepeater::make('social') ->headers(['name' => 'Product Name', 'qty' -> 'Quantity'])

Expected behavior

For the headers to work

Steps to reproduce

Provide an array to the headers() method without specifying keys.

Reproduction repository

No response

Relevant log output

No response

awcodes commented 5 months ago

Has been updated. Thanks.