How to show associated attachment model images in forms?

Currently there is the IdentityVerification model. IdentityVerification and Attachment are one-to-many relationships. I want to display the Attachment of the current message in the resource edit page of IdentityVerification, what should I do?
public function attachments()
{
return $this->hasMany(Attachment::class, 'model_id');
}
public function attachments()
{
return $this->hasMany(Attachment::class, 'model_id');
}
Section::make('info')
->description('info')
->aside()
->schema([
Repeater::make('attachments')
->relationship()
->schema([
FileUpload::make('paths')->image()
])
->addable(false)
->deletable(false)
])
Section::make('info')
->description('info')
->aside()
->schema([
Repeater::make('attachments')
->relationship()
->schema([
FileUpload::make('paths')->image()
])
->addable(false)
->deletable(false)
])
paths is the field associated with the model attachment. It is the address of an image. I want it to show up. I don't know how to do it.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server