F
Filament14mo ago
Zyel

RepeatableEntry not loop when inside scheme contain Sections

when i try repeatable entry with section inside, its only repeat the first object this the code: RepeatableEntry::make('published.edited_history')->schema([ ComponentsSection::make('history')->schema([ TextEntry::make('modify_at'), TextEntry::make('article_category'), TextEntry::make('title')->label('Judul Artikel'), ImageEntry::make('thumbnail')->label('Gambar Cover'), TextEntry::make('content')->html()->columnSpanFull(), ]) ]),
4 Replies
_andypeacock
_andypeacock14mo ago
Hi, did you get a solution? I've got the same problem. But if I dd() the record before returning the infolist, the dd shows the correct unique entries. Wouldn't you know, I just got it sorted (by the magic technique of Random Button Pressing).
TextEntry::make('message')
->columnSpanFull()
->getStateUsing(function (Message $record) {
return $record->message;
}),
TextEntry::make('message')
->columnSpanFull()
->getStateUsing(function (Message $record) {
return $record->message;
}),
Sandeep
Sandeep14mo ago
May it will help you, as I have applied like this public static function infolist(Infolist $infolist): Infolist { return $infolist ->schema([ Section::make('Variant Base Price')->schema([ RepeatableEntry::make('productVariantPrice')->label('') ->schema([ TextEntry::make('qty')->color('success'), TextEntry::make('price')->color('warning'), ])->columns(2)->grid(6), Section::make('Additions')->schema([ RepeatableEntry::make('productAddition')->label('') ->schema([ TextEntry::make('type')->state(function (Model $record) { return $record->type ? $record->type : $record->description; }), TextEntry::make('setup'), TextEntry::make('currency'), TextEntry::make('lead_time'), TextEntry::make('description')->columnSpanFull(), Section::make('Prices')->schema([ RepeatableEntry::make('productAdditionPrice')->label('') ->schema([ TextEntry::make('qty')->color('success'), TextEntry::make('price')->color('warning'), ])->columns(2)->grid(6), ]), ])->columns(5), ]), ])]); }
Sandeep
Sandeep14mo ago
No description
_andypeacock
_andypeacock14mo ago
Thanks - I can't work out why I had to use getStateUsing(), but at least we both got it sorted.
Want results from more Discord servers?
Add your server