浏览代码

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');
     }
 
+    public function permalink()
+    {
+        $path = $this->actor->permalink("/follow/{$this->id}");
+        return url($path);
+    }
+
     public function toText()
     {
         $actorName = $this->actor->username;