|
| 1 | +# Display Filament RepeatableEntry as table |
| 2 | + |
| 3 | +[](https://packagist.org/packages/icetalker/filament-table-repeatable-entry) |
| 4 | +[](https://github.com/icetalker/filament-table-repeatable-entry/actions?query=workflow%3Arun-tests+branch%3Amain) |
| 5 | +[](https://github.com/icetalker/filament-table-repeatable-entry/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain) |
| 6 | +[](https://packagist.org/packages/icetalker/filament-table-repeatable-entry) |
| 7 | + |
| 8 | +This is a Filament InfolistS Component, use for display RepetableEntry as a table. |
| 9 | + |
| 10 | +## Installation |
| 11 | + |
| 12 | +You can install the package via composer: |
| 13 | + |
| 14 | +```bash |
| 15 | +composer require icetalker/filament-table-repeatable-entry |
| 16 | +``` |
| 17 | + |
| 18 | +## Usage |
| 19 | + |
| 20 | +```php |
| 21 | +namespace Icetalker\FilamentTableRepeater\Forms\Components; |
| 22 | + |
| 23 | +TableRepeatableEntry::make('items') |
| 24 | + ->schema([ |
| 25 | + Infolists\Components\TextEntry::make('product'), |
| 26 | + Infolists\Components\TextEntry::make('quantity'), |
| 27 | + Infolists\Components\TextEntry::make('price'), |
| 28 | + ]) |
| 29 | + ->columnSpan(2), |
| 30 | +``` |
| 31 | + |
| 32 | +### Striped Row |
| 33 | + |
| 34 | +To enable striped table rows, you can use the `striped()` method: |
| 35 | + |
| 36 | +```php |
| 37 | +namespace Icetalker\FilamentTableRepeater\Forms\Components; |
| 38 | + |
| 39 | +TableRepeatableEntry::make('items') |
| 40 | + ->schema([ |
| 41 | + Infolists\Components\TextEntry::make('product'), |
| 42 | + Infolists\Components\TextEntry::make('quantity'), |
| 43 | + Infolists\Components\TextEntry::make('price'), |
| 44 | + ]) |
| 45 | + ->striped() |
| 46 | + ->columnSpan(2), |
| 47 | +``` |
| 48 | + |
| 49 | +### Show Index |
| 50 | + |
| 51 | +To show table row index, please use `showIncdex()`: |
| 52 | + |
| 53 | +```php |
| 54 | +namespace Icetalker\FilamentTableRepeater\Forms\Components; |
| 55 | + |
| 56 | +TableRepeatableEntry::make('items') |
| 57 | + ->schema([ |
| 58 | + Infolists\Components\TextEntry::make('product'), |
| 59 | + Infolists\Components\TextEntry::make('quantity'), |
| 60 | + Infolists\Components\TextEntry::make('price'), |
| 61 | + ]) |
| 62 | + ->striped() |
| 63 | + ->columnSpan(2), |
| 64 | +``` |
| 65 | + |
| 66 | + |
| 67 | +## Changelog |
| 68 | + |
| 69 | +Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. |
| 70 | + |
| 71 | +## Contributing |
| 72 | + |
| 73 | +Please see [CONTRIBUTING](CONTRIBUTING.md) for details. |
| 74 | + |
| 75 | +## Security Vulnerabilities |
| 76 | + |
| 77 | +Please review [our security policy](../../security/policy) on how to report security vulnerabilities. |
| 78 | + |
| 79 | +## Credits |
| 80 | + |
| 81 | +- [Martin Hwang](https://github.com/icetalker) |
| 82 | +- [All Contributors](../../contributors) |
| 83 | + |
| 84 | +## License |
| 85 | + |
| 86 | +The MIT License (MIT). Please see [License File](LICENSE.md) for more information. |
0 commit comments