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

Prevent header errors in most conditions #109

Closed margarizaldi closed 3 months ago

margarizaldi commented 4 months ago

This fix is intended to address some inconveniences that cause errors:

TableRepeater::make('childrens')
    ->headers([
        null,
        Header::make('Agent Code')->align('center'),
        'Registered at',
    ])
    ->schema([
        TextInput::make('name'),
        TextInput::make('code'),
        TextInput::make('created_at'),
        TextInput::make('updated_at'),
    ])
margarizaldi commented 4 months ago

will check the test failure soon

awcodes commented 4 months ago

There is going to have to be a lot more checks in the getHeaders() method. See the 2.x branch. This is why it was changed in v3 to make it more explicit.

margarizaldi commented 4 months ago

Hi @awcodes, yes indeed, I've been using this plugin since v2. If that's your concern, I really appreciate that.

I was just thinking that filament itself does a lot of checks to just work, so adding a couple more checks won't make any noticeable impact. And similar to our experience in creating filament table.

The decision is yours after all...