Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

pujanmaharjan's avatar

Nested Repeater Issue

I have a form with a repeater 'project_information' which also includes another repeater 'attachments'. Single project can have multiple repeaters, I somehow saved the data but in edit I cannot get the saved data. In normal repeater with only one attachment its working. I am using mount() function to populate the data in edit. The nested attachment repeater is not in relation but saved in json format. Normal Repeater with one attachement: [ 'attachment' => [ 0 => 'filename.jpg' ] ] this works for simple repeater with only one attachment but same doesn't work for nested attachment repeater inside a project repeater.

0 likes
1 reply
AddWebContribution's avatar

I think your nested repeater structure is not being properly hydrated in the mount() when a single project_information can have multiple attachments within it, your structure should look something like this when you save it:

[
    [
        'title' => 'Project A',
        'description' => 'Text 1',
        'attachments' => [
            ['file' => 'file1.jpg'],
            ['file' => 'file2.jpg'],
        ]
    ],
    [
        'title' => 'Project B',
        'description' => 'Text 2',
        'attachments' => [
            ['file' => 'another1.jpg'],
        ]
    ]
]

try to decode the JSON in your mount() method and format it to match the structure.

Please or to participate in this conversation.