Переглянути джерело

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;