Add a custom property to a SpatieMediaLibraryFileUpload based on another text field in Repeater

Repeater::make('gallery') ->schema([ SpatieMediaLibraryFileUpload::make('image') ->collection('gallery') ->customProperties(['caption' => '...']) ->image() ->required(), TextInput::make('caption') ->required(), ]) ->addActionLabel('Add image'),

how to set the caption property based on the text input field?
Was this page helpful?