ahmedkandel / nova-s3-multipart-upload

A Laravel Nova resource tool to upload files directly to Amazon S3. You can (upload | download | delete) single, multiple, small or big files.
MIT License
22 stars 22 forks source link

How to use the package with a HasMany relation? #21

Closed chinleung closed 2 years ago

chinleung commented 2 years ago

Hi,

I'm looking for an example on how to make the field work with a HasMany relation.

I have the following:

NovaS3MultipartUpload::make(__('Images'), ReviewImage::class)
    ->hasMany('path')
    ->allowMultipleUploads()
    ->disk('s3'),

I'm getting the following error in the console:

image

I'm using Laravel Nova v3.29.0.

chinleung commented 2 years ago

Ah nevermind, I had to use relationship's function name instead of the class name.

NovaS3MultipartUpload::make(__('Images'), 'images')
    ->hasMany('path')
    ->allowMultipleUploads()
    ->disk('s3'),