Repeater and SpatieUpload Fill

Trying to do set a repeater field using
->afterStateUpdated(function (Get $get, Set $set) {
    $this->participant = Participant::find($get('participant_id'));
    $mediaItems = $this->participant->media;
    $attachments = $mediaItems->map(function ($media) {
        return [
            'attachment' => $media,
            'name' => $media->collection_name,
        ];
    })->toArray();

    ray($attachments)->label('Attachments');

    $set('attachments', $attachments);
})
with the repeater having
->schema([
    SpatieMediaLibraryFileUpload::make('attachment')
        ->previewable(false)
        ->reactive()
        ->required()
        ->hiddenLabel(),
    TextInput::make('name')
        ->hiddenLabel()
        ->placeholder('File Name')
        ->reactive()
        ->required(),
]),
. Im filling the name file, but getting
Filament\Forms\Components\SpatieMediaLibraryFileUpload::Filament\Forms\Components\{closure}(): Argument #2 ($file) must be of type string, array given, called in /#######/vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35
. Tried a few different ideas with media() on 'attachment', but im obviously missing something simple.
Was this page helpful?