You can install the package via composer:
composer require awcodes/filament-table-repeater
This field has most of the same functionality of the Filament Repeater field. The main exception is that this field can not be collapsed.
TableRepeater::make('social')
->schema([
Select::make('platform')
->disableLabel()
->options([
'facebook' => 'Facebook',
'twitter' => 'Twitter',
'instagram' => 'Instagram'
]),
TextInput::make('handle')
->disableLabel(),
])
->columnSpan('full')
By default, Table Repeater will automatically create the table headers from your schema labels. This can be overridden by simply passing an array of your desired headers to the ->headers()
method.
TableRepeater::make('social')
->headers(['Platform', 'Handle'])
->schema([
...
])
->columnSpan('full')
To automatically hide all the labels of the fields in the table use the ->hideLabels()
method.
TableRepeater::make('social')
->hideLabels()
->schema([
...
])
To customize the text shown when the table is empty, use the ->emptyLabel()
method.
TableRepeater::make('social')
->emptyLabel('There is no platform registered.')
->schema([
...
])
Sometimes we don't want to have the table header at all. To achieve this, use the ->withoutHeader()
method.
TableRepeater::make('social')
->withoutHeader()
->schema([
...
])
To set the width of columns in the table use the columnWidths()
method.
Widths should be set in px as a string.
TableRepeater::make('social')
->columnWidths([
'platform' => '200px',
])
->schema([
Select::make('platform'), // will be 200px wide
TextInput::make('handle'), // will be default stretched width
])
Below a specific break point the table will render as a set of panels to
make working with data easier on mobile devices. The default is 'md', but
can be overridden with the breakPoint()
method.
TableRepeater::make('social')
->breakPoint('sm') // accepts Tailwind CSS screen sizes
->schema([
Select::make('platform'),
TextInput::make('handle'),
])
If you are using a custom theme for Filament you will need to add this plugin's views to your Tailwind CSS config.
content: [
...
"./vendor/awcodes/filament-table-repeater/resources/views/**/*.blade.php",
],
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.