1
0
Fork 0

Update Status Model

This commit is contained in:
Daniel Supernault 2019-01-14 22:34:50 -07:00
parent 30758e5e67
commit 9765ec3d68
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 16 additions and 0 deletions

View File

@ -274,6 +274,22 @@ class Status extends Model
__('notification.commented');
}
public function shareToText()
{
$actorName = $this->profile->username;
return "{$actorName} ".__('notification.shared');
}
public function shareToHtml()
{
$actorName = $this->profile->username;
$actorUrl = $this->profile->url();
return "<a href='{$actorUrl}' class='profile-link'>{$actorName}</a> ".
__('notification.shared');
}
public function recentComments()
{
return $this->comments()->orderBy('created_at', 'desc')->take(3);