How to make inline repeater's content show up in preview/revision mode?

Client facing website;
No description
11 Replies
Dakaa
DakaaOP2y ago
But on admin preview mode:
No description
ifox
ifox2y ago
How is your repeater stored? JSON? HasMany relationship? How are you accessing it when rendering your frontend?
Dakaa
DakaaOP2y ago
the block's code resources/views/components/twill/blocks/header.blade.php:
@foreach($block->children()->get()->where('child_key', 'menu-item') ?? [] as $child)
@foreach($block->children()->get()->where('child_key', 'menu-item') ?? [] as $child)
ifox
ifox2y ago
remove parenthesis after children
ifox
ifox2y ago
And ->get()
Dakaa
DakaaOP2y ago
let me try
Dakaa
DakaaOP2y ago
No description
Dakaa
DakaaOP2y ago
Perfect, thankyou! TIL
ifox
ifox2y ago
in the preview relationship are hydrated, so if you add parenthesis Laravel makes a query in the database instead of using already loaded relationships
Dakaa
DakaaOP2y ago
i see it now, i dd()'ed both @ifox.dev thankyou once again

Did you find this page helpful?