Display already uploaded image using Upload field #2028
-
I am using upload field with group like: Upload::make('invites')
->title('Invites')
->groups('invites') And everything works fine when creating new records. How to display already uploaded images when in edit mode, I mean to display like when you upload something like: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I found that there is a hidden modal for search already uploaded files, but no way to open it. and probably the class enter-scale should be center-scale |
Beta Was this translation helpful? Give feedback.
-
I was able to solve this but would be good to have something in the docs about it. // In the model
public function imagesInvite(): MorphToMany
{
return $this->attachment('exposition-invite');
}
// In the screen query() method
$this->exposition->load('imagesInvite');
// In the layout
Upload::make('exposition.imagesInvite')
->title('Invites')
->groups('exposition-invite') The name of input upload should match the data from model, in my case exposition.imagesInvite |
Beta Was this translation helpful? Give feedback.
I was able to solve this but would be good to have something in the docs about it.
The name of input upload should match the data from model, in my case exposition.imagesInvite