Explorar o código

Update Follower model, add permalink method

Daniel Supernault %!s(int64=6) %!d(string=hai) anos
pai
achega
2876ec30d4
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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;