1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-23 00:05:29 +00:00

Update Follower model

This commit is contained in:
Daniel Supernault 2018-11-03 21:16:19 -06:00
parent c42f0fd80a
commit 836030c527
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -6,6 +6,9 @@ use Illuminate\Database\Eloquent\Model;
class Follower extends Model
{
protected $fillable = ['profile_id', 'following_id', 'local_profile'];
public function actor()
{
return $this->belongsTo(Profile::class, 'profile_id', 'id');
@ -21,9 +24,9 @@ class Follower extends Model
return $this->belongsTo(Profile::class, 'following_id', 'id');
}
public function permalink()
public function permalink($append = null)
{
$path = $this->actor->permalink("/follow/{$this->id}");
$path = $this->actor->permalink("/follow/{$this->id}{$append}");
return url($path);
}