mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
Update Status model, add new methods
This commit is contained in:
parent
774557e8c9
commit
203034b971
1 changed files with 13 additions and 0 deletions
|
@ -52,6 +52,14 @@ class Status extends Model
|
||||||
return url($path);
|
return url($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function permalink($suffix = '/activity')
|
||||||
|
{
|
||||||
|
$id = $this->id;
|
||||||
|
$username = $this->profile->username;
|
||||||
|
$path = config('app.url') . "/p/{$username}/{$id}{$suffix}";
|
||||||
|
return url($path);
|
||||||
|
}
|
||||||
|
|
||||||
public function editUrl()
|
public function editUrl()
|
||||||
{
|
{
|
||||||
return $this->url() . '/edit';
|
return $this->url() . '/edit';
|
||||||
|
@ -174,4 +182,9 @@ class Status extends Model
|
||||||
return "<a href='{$actorUrl}' class='profile-link'>{$actorName}</a> " .
|
return "<a href='{$actorUrl}' class='profile-link'>{$actorName}</a> " .
|
||||||
__('notification.commented');
|
__('notification.commented');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function recentComments()
|
||||||
|
{
|
||||||
|
return $this->comments()->orderBy('created_at','desc')->take(3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue