mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-14 02:24:31 +00:00
33 lines
678 B
PHP
33 lines
678 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Like extends Model
|
|
{
|
|
public function actor()
|
|
{
|
|
return $this->belongsTo(Profile::class, 'profile_id', 'id');
|
|
}
|
|
|
|
public function status()
|
|
{
|
|
return $this->belongsTo(Status::class);
|
|
}
|
|
|
|
public function toText()
|
|
{
|
|
$actorName = $this->actor->username;
|
|
return "{$actorName} " . __('notification.likedPhoto');
|
|
}
|
|
|
|
public function toHtml()
|
|
{
|
|
$actorName = $this->actor->username;
|
|
$actorUrl = $this->actor->url();
|
|
return "<a href='{$actorUrl}' class='profile-link'>{$actorName}</a> " .
|
|
__('notification.likedPhoto');
|
|
}
|
|
}
|