|
@@ -27,19 +27,20 @@ class Like extends Model
|
|
|
return $this->belongsTo(Status::class);
|
|
|
}
|
|
|
|
|
|
- public function toText()
|
|
|
+ public function toText($type = 'post')
|
|
|
{
|
|
|
$actorName = $this->actor->username;
|
|
|
+ $msg = $type == 'post' ? __('notification.likedPhoto') : __('notification.likedComment');
|
|
|
|
|
|
- return "{$actorName} ".__('notification.likedPhoto');
|
|
|
+ return "{$actorName} ".$msg;
|
|
|
}
|
|
|
|
|
|
- public function toHtml()
|
|
|
+ public function toHtml($type = 'post')
|
|
|
{
|
|
|
$actorName = $this->actor->username;
|
|
|
$actorUrl = $this->actor->url();
|
|
|
+ $msg = $type == 'post' ? __('notification.likedPhoto') : __('notification.likedComment');
|
|
|
|
|
|
- return "<a href='{$actorUrl}' class='profile-link'>{$actorName}</a> ".
|
|
|
- __('notification.likedPhoto');
|
|
|
+ return "<a href='{$actorUrl}' class='profile-link'>{$actorName}</a> ".$msg;
|
|
|
}
|
|
|
}
|