ソースを参照

Update Activity model

Daniel Supernault 6 年 前
コミット
884f675d30
1 ファイル変更10 行追加0 行削除
  1. 10 0
      app/Activity.php

+ 10 - 0
app/Activity.php

@@ -7,4 +7,14 @@ use Illuminate\Database\Eloquent\Model;
 class Activity extends Model
 {
     protected $dates = ['processed_at'];
+
+	public function toProfile()
+	{
+		return $this->belongsTo(Profile::class, 'to_id');
+	}
+
+	public function fromProfile()
+	{
+		return $this->belongsTo(Profile::class, 'from_id');
+	}
 }