From f7503d1f20f70ebaabfe5939a29c2a91c425c777 Mon Sep 17 00:00:00 2001 From: James Collins Date: Wed, 29 Mar 2023 14:58:31 +1000 Subject: [PATCH] belongs to media --- app/Models/Attachment.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index b1bc6f2..d63355d 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -25,4 +25,13 @@ class Attachment extends Model public function attachable() { return $this->morphTo(); - }} + } + + /** + * Get the media for this attachment. + */ + public function media() + { + return $this->belongsTo(Media::class); + } +} \ No newline at end of file