浏览代码

Update Status Model

Daniel Supernault 6 年之前
父节点
当前提交
9765ec3d68
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16 0
      app/Status.php

+ 16 - 0
app/Status.php

@@ -274,6 +274,22 @@ class Status extends Model
           __('notification.commented');
           __('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()
     public function recentComments()
     {
     {
         return $this->comments()->orderBy('created_at', 'desc')->take(3);
         return $this->comments()->orderBy('created_at', 'desc')->take(3);