Search code examples
yajra-datatable

I am not sure how to use Yajra's Multi-file upload field "uploadMany"


Datatables has support for uploadMany https://editor.datatables.net/reference/field/uploadMany

I see Yajra added it late last year https://github.com/yajra/laravel-datatables-editor/pull/38

Does anyone have any sample code as I'm obviously not calling it correctly:

Fields\Image::make('photo_link2')->type('uploadMany')

I'm getting "Uncaught Upload collections must have an array as a value"

I need to add that 'upload' works fine.


Solution

  • Great answer from Yajra on GitHub:

    File::make('property_documents[]')->multiple()->label('Property Documents'),