소스 검색

Update StatusHashtag model, add media relation

Daniel Supernault 6 년 전
부모
커밋
7ffb4c4a45
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      app/StatusHashtag.php

+ 12 - 0
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'
+        );
+	}
 }