From 7ffb4c4a450be192f3563bae898edb191c37cb4f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 1 Jul 2019 23:06:37 -0600 Subject: [PATCH] Update StatusHashtag model, add media relation --- app/StatusHashtag.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/StatusHashtag.php b/app/StatusHashtag.php index 15e28202..de67ebd6 100644 --- a/app/StatusHashtag.php +++ b/app/StatusHashtag.php @@ -26,4 +26,16 @@ class StatusHashtag extends Model { return $this->belongsTo(Profile::class); } + + public function media() + { + return $this->hasManyThrough( + Media::class, + Status::class, + 'id', + 'status_id', + 'status_id', + 'id' + ); + } }