Can I repeat infoList in grid instead of table?

Hey Everyone. I'm trying to get a 'card' repeated in a grid from an Eloquent collection - is this possible? I reckon I can use an info-list to create a card similar to the one pictured, but I've looked at the docs several times, examining various possible ways of doing it, but I always reach a dead-end. Does anybody have any ideas as to how I can have a grid of these cards displayed? I'm pretty confident that there's a way to do it, and I'm just missing it. OR Thinking about it, as I'm typing this - Am I better off just creating a 'stack' for the records. The only problem I foresee with that is that I can no longer easily style them Any help appreciated. John
No description
4 Replies
GrandadEvans
GrandadEvans4mo ago
Hey @jaocero that's one of the options I looked at, the dead-end (more like a traffic jam) I ran into was that I couldn't figure out how to repeat the Infolist. I couldn't get it to repeat through the Table as it wasn't the correct type. Is there something I've missed? Thanks for replying by the way Ignore my last mesage. I'm thinking of a different thing. It must be a different reason I didn't use RepeatableEntry. I'll look at it again
jaocero
jaocero4mo ago
Example in this code below:
RepeatableEntry::make('comments')
->schema([
TextEntry::make('author.name'),
TextEntry::make('title'),
TextEntry::make('content')
->columnSpan(2),
])
->columns(2)
RepeatableEntry::make('comments')
->schema([
TextEntry::make('author.name'),
TextEntry::make('title'),
TextEntry::make('content')
->columnSpan(2),
])
->columns(2)
the comments should be a collection or an array so so that it will be reapeted again and again until now items to be repeated. And then you can use the https://filamentphp.com/docs/3.x/infolists/entries/custom to make a custom card same with your design.
RepeatableEntry::make('comments')
->schema([
ViewEntry::make('sample')
->view('filament.infolists.entries.sample')
])
->columns(2)
RepeatableEntry::make('comments')
->schema([
ViewEntry::make('sample')
->view('filament.infolists.entries.sample')
])
->columns(2)
idk if this is the best solution but the idea is you can make a custom view entry to suite your design and make repeatable entry to make a cardable grid design
GrandadEvans
GrandadEvans3mo ago
Modal form Sorry. New to the Android app... I thought that was a search box😆