Browse Source

Update Activity model

Daniel Supernault 6 năm trước cách đây
mục cha
commit
884f675d30
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  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');
+	}
 }