Sfoglia il codice sorgente

Update StatusHashtag model, add media relation

Daniel Supernault 6 anni fa
parent
commit
7ffb4c4a45
1 ha cambiato i file con 12 aggiunte e 0 eliminazioni
  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'
+        );
+	}
 }