فهرست منبع

Update Follower model, add permalink method

Daniel Supernault 6 سال پیش
والد
کامیت
2876ec30d4
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      app/Follower.php

+ 6 - 0
app/Follower.php

@@ -21,6 +21,12 @@ class Follower extends Model
         return $this->belongsTo(Profile::class, 'following_id', 'id');
         return $this->belongsTo(Profile::class, 'following_id', 'id');
     }
     }
 
 
+    public function permalink()
+    {
+        $path = $this->actor->permalink("/follow/{$this->id}");
+        return url($path);
+    }
+
     public function toText()
     public function toText()
     {
     {
         $actorName = $this->actor->username;
         $actorName = $this->actor->username;